io.realm.annotations
Implemented interfaces:
Esta anotación marcará el campo o el elemento en io.realm.RealmList como no nulo.
Cuando un campo de tipo Boolean, Byte, Short, Integer, Long, Float, Double, String, byte[], Date está anotado con Obligatorio, no se puede establecer en null y Realm lanzará una excepción si sucede.
Los campos con tipos primitivos son implícitamente obligatorios. Tenga en cuenta que String no es un tipo primitivo, por lo que en Java acepta valores nulos por defecto, a menos que esté marcado como @Required . En Kotlin, ocurre lo contrario, por lo que String no es nulo. Para especificar una cadena que acepta valores nulos en Kotlin, debe usar String? .
If this annotation is used on a RealmList , the annotation is applied to the elements inside the list and not the list itself. The list itself is always non-null. This means that a list marked with this annotation are never allowed to hold null values even if the datatype would otherwise allow it. Realm will throw an exception if you attempt to store null values into a list marked @Required .
This annotation cannot be used on a RealmAny , as the inner value of a RealmAny field is always nullable. Realm will throw an exception if you attempt mark a RealmAny as @Required .
La compilación fallará si la anotación requerida se coloca en un que RealmList contiene referencias a otros objetos de Realm.