public enum ImportFlag extends Enum<ImportFlag>
Enum Constant and Description |
---|
CHECK_SAME_VALUES_BEFORE_SET
With this flag enabled, fields will not be written to the Realm file if they contain the same
value as the value already present in the Realm.
|
Modifier and Type | Method and Description |
---|---|
static ImportFlag |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ImportFlag[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ImportFlag CHECK_SAME_VALUES_BEFORE_SET
For local Realms this only has an impact on change listeners which will not report changes to those fields that was not written.
For synchronized Realms this also impacts the server, which will see improved performance as there is less changes to upload and merge into the server Realm.
It also impact how the server merges changes from different devices. Realm uses a last-write-wins approach when merging individual fields in an object, so if a field is not written it will be considered "older" than other fields modified.
E.g:
public static ImportFlag[] values()
for (ImportFlag c : ImportFlag.values()) System.out.println(c);
public static ImportFlag valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null