RealmDictionary
A RealmDictionary
is a specialization for RealmMaps whose keys are Strings
.
Similarly to RealmList or RealmSet, RealmMap
can operate in managed and unmanaged modes. In managed mode a RealmDictionary
persists all its contents in a Realm instance whereas unmanaged dictionaries are backed by an in-memory LinkedHashMap.
A managed dictionary can only be created by Realm and will automatically update its content whenever its underlying realm is updated. Managed dictionaries can only be accessed using the getter that points to a RealmDictionary
property of a managed RealmObject.
Unmanaged dictionaries can be created by calling realmDictionaryOf and may contain both managed and unmanaged RealmObjects. Unmanaged dictionaries can be added to a realm using the MutableRealm.copyToRealm function with an object containing an unmanaged dictionary.
A RealmDictionary
may contain any type of Realm primitive nullable and non-nullable values. RealmObjects and EmbeddedRealmObjects are also supported but must be declared nullable.
Parameters
the type of the values stored in this map