@Retention(value=RUNTIME) @Target(value=FIELD) public @interface Required
RealmList
as not nullable.
When a field of type Boolean, Byte, Short, Integer, Long, Float, Double, String, byte[], Date
is annotated
with Required
, it cannot be set to null
.
Fields with primitive types are implicitly required.
When a primitive RealmList
(RealmList<String>, RealmList<byte[]>, RealmList<Boolean>,
RealmList<Byte>, RealmList<Short>, RealmList<Integer>, RealmList<Long>, RealmList<Float>, RealmList<Double>,
RealmList<Date>
) is annotated with Required
, it cannot contain null
values.
The RealmList
field itself is required always.
Compiling will fail when fields with other types have Required
annotation.