Docs Menu
Docs Home
/ /
Atlas Device SDKs
/ / /

Class RealmDictionary

On this page

  • io.realm
  • Constructors
  • Inherited Methods
  • Constructor Detail
io.realm.RealmDictionary

Specialization of RealmMap s whose keys are strings.

Similarly to RealmList s, a RealmDictionary can operate in managed and unmanaged modes. In managed mode a RealmDictionary persists all its contents inside a Realm whereas in unmanaged mode it functions like a HashMap .

Managed RealmDictionaries can only be created by Realm and will automatically update its content whenever the underlying Realm is updated. Managed RealmDictionaries can only be accessed using the getter that points to a RealmDictionary field of a RealmObject .

Unmanaged RealmDictionaries can be created by the user and can contain both managed and unmanaged RealmObjects. This is useful when dealing with JSON deserializers like GSON or other frameworks that inject values into a class. Unmanaged RealmDictionaries can be added to a Realm using the Realm.copyToRealm(Iterable, ImportFlag...) method.

Constructor and Description

Instantiates a RealmDictionary in unmanaged mode.

Instantiates a RealmDictionary in unmanaged mode with an initial dictionary.

  • Methods inherited from class java.lang.Object : getClass , hashCode , equals , clone , toString , notify , notifyAll , wait , wait , wait , finalize

  • Methods inherited from class io.realm.RealmMap : isManaged , isValid , isFrozen , size , isEmpty , containsKey , containsValue , get , put , remove , putAll , clear , keySet , values , entrySet , freeze , addChangeListener , addChangeListener , removeChangeListener , removeChangeListener , removeAllChangeListeners

public RealmDictionary ()

Instantiates a RealmDictionary in unmanaged mode.

Instantiates a RealmDictionary in unmanaged mode with an initial dictionary.

Parameters

  • map - initial dictionary

← Class RealmConfiguration.Builder