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()
Deprecated.
RealmSchema doesn't have to be released manually. |
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<RealmObjectSchema> |
getAll()
Returns the
RealmObjectSchema s 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.
|
@Deprecated public abstract void close()
RealmSchema
doesn't have to be released manually.public abstract RealmObjectSchema get(String className)
className
- name of the classnull
if the class doesn't exists.public abstract Set<RealmObjectSchema> getAll()
RealmObjectSchema
s 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.