create Object
Instantiates and adds a new object to the Realm.
This method is only available for model classes with no @PrimaryKey
annotation. If you like to create an object that has a primary key, use createObject instead.
Return
the new object.
Parameters
the Class of the object to create.
Throws
if the primary key is defined in the model class or an object cannot be created.
Instantiates and adds a new object to the Realm with the primary key value already set.
If the value violates the primary key constraint, no object will be added and a RealmException will be thrown. The default value for primary key provided by the model class will be ignored.
Return
the new object.
Parameters
the Class of the object to create.
value for the primary key field.
Throws
if object could not be created due to the primary key being invalid.
if the model class does not have an primary key defined.
if the primaryKeyValue
doesn't have a value that can be converted to the expected value.