Class RealmSchema
On this page
io.realm
Class for interacting with the Realm schema. This makes it possible to inspect, add, delete and change the classes in the Realm.:ref:Realm.getSchema() <io_realm_Realm_getSchema__>
returns an immutable RealmSchema
which can only be used for inspecting. Use DynamicRealm.getSchema() to get a mutable schema.
All changes must happen inside a write transaction for the particular Realm.
Method Summary
Modifier and Type | Method and Description |
---|---|
public boolean | |
public abstract RealmObjectSchema | |
public void | Create the underlying keypath mapping. |
public abstract RealmObjectSchema | String className, String primaryKeyFieldName, java.lang.Class<?> fieldType, io.realm.FieldAttribute[] attributes ) Adds a new class to the Realm with a primary key field defined. |
public abstract RealmObjectSchema | Returns the RealmObjectSchema for a given class. |
public abstract Set | getAll () Returns the RealmObjectSchema s for all RealmObject classes that can be saved in this Realm. |
protected final ColumnInfo | |
public abstract void | |
public abstract RealmObjectSchema |
Inherited Methods
Methods inherited from class java.lang.Object :
getClass
,hashCode
,equals
,clone
,toString
,notify
,notifyAll
,wait
,wait
,wait
,finalize
Method Detail
contains
create
Adds a new class to the Realm. Parameters
Returns a Realm schema object for that class. Throws
|
createKeyPathMapping
public void createKeyPathMapping () |
---|
Create the underlying keypath mapping. Should only be called by typed Realms. |
createWithPrimaryKeyField
public abstract RealmObjectSchema createWithPrimaryKeyField ( String className, String primaryKeyFieldName, java.lang.Class<?> fieldType, io.realm.FieldAttribute[] attributes ) |
---|
Adds a new class to the Realm with a primary key field defined. Parameters
Returns a Realm schema object for that class. Throws
|
get
Returns the RealmObjectSchema for a given class. If this RealmSchema is immutable, an immutable RealmObjectSchema will be returned. Otherwise, it returns a mutable RealmObjectSchema . Parameters
Returns schema object for that class or |
getAll
Returns the RealmObjectSchema s for all RealmObject classes that can be saved in this Realm. If this RealmSchema is immutable, an immutable RealmObjectSchema set will be returned. Otherwise, it returns an mutable RealmObjectSchema set. Returns the set of all classes in this Realm or no RealmObject classes can be saved in the Realm. |
getColumnInfo
remove
Removes a class from the Realm. All data will be removed. Removing a class while other classes point to it will throw an IllegalStateException . Removes those classes or fields first. Parameters
Throws
|
rename
Renames a class already in the Realm. Parameters
Returns a schema object for renamed class. Throws
|