public abstract class RealmObject extends java.lang.Object
An annotation processor will create a proxy class for your RealmObject subclass. The getters and setters should not contain any custom code of logic as they are overridden as part of the annotation process.
A RealmObject is currently limited to the following:
The following field data types are supported (no boxed types):
long are mapped to
when storing within a Realm.
Getter and setter names must have the name
the field name is
XXX. Getters for fields of type boolean can be called
well. Fields with a m-prefix must have getters and setters named setmXXX and getmXXX which is
the default behavior when Android Studio automatically generates the getters and setters.
Fields annotated with
Ignore don't have these restrictions and
don't require either a getter or setter.
Realm will create indexes for fields annotated with
will speedup queries but will have a negative impact on inserts and updates.
A RealmObject cannot be passed between different threads.
|Modifier and Type||Field and Description|
|Constructor and Description|
|Modifier and Type||Method and Description|
Check if the RealmObject is still valid to use ie.
Removes the object from the Realm it is currently associated to.
protected Row row
protected Realm realm
public void removeFromRealm()
After this method is called the object will be invalid and any operation (read or write) performed on it will fail with an IllegalStateException
public boolean isValid()
Realmbeen closed. It will always return false for stand alone objects.
trueif the object is still accessible,
falseotherwise or if it is a standalone object.