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