public abstract class RealmSchema extends Object
All changes must happen inside a write transaction for the particular Realm.
RealmMigration| Constructor and Description |
|---|
RealmSchema() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
close()
Release the schema and any of native resources it might hold.
|
abstract boolean |
contains(String className)
Checks if a given class already exists in the schema.
|
abstract RealmObjectSchema |
create(String className)
Adds a new class to the Realm.
|
abstract RealmObjectSchema |
get(String className)
Returns the Realm schema for a given class.
|
abstract Set<? extends RealmObjectSchema> |
getAll()
Returns the
RealmObjectSchemas for all RealmObject classes that can be saved in this Realm. |
abstract void |
remove(String className)
Removes a class from the Realm.
|
abstract RealmObjectSchema |
rename(String oldClassName,
String newClassName)
Renames a class already in the Realm.
|
public abstract void close()
public abstract RealmObjectSchema get(String className)
className - name of the classnull if the class doesn't exists.public abstract Set<? extends RealmObjectSchema> getAll()
RealmObjectSchemas for all RealmObject classes that can be saved in this Realm.public abstract RealmObjectSchema create(String className)
className - name of the class.public abstract void remove(String className)
IllegalStateException. Removes those classes or fields first.className - name of the class to remove.public abstract RealmObjectSchema rename(String oldClassName, String newClassName)
oldClassName - old class name.newClassName - new class name.public abstract boolean contains(String className)
className - class name to check.true if the class already exists. false otherwise.