Class DittoCborSerializable.Dictionary

java.lang.Object
com.ditto.java.serialization.DittoCborSerializable
com.ditto.java.serialization.DittoCborSerializable.Dictionary
Enclosing class:
DittoCborSerializable

public static final class DittoCborSerializable.Dictionary extends DittoCborSerializable

Represents a CBOR dictionary (map) value.

Dictionaries are key-value mappings where both keys and values are CBOR-serializable. This class is immutable.

Use DittoCborSerializable.buildDictionary() to create a new dictionary.

  • Method Details

    • getImplementation

      protected @NonNull com.ditto.internal.serialization.InternalDittoCborSerializable.Dictionary getImplementation()
      Description copied from class: DittoCborSerializable
      Returns the internal CBOR serializable implementation.
      Overrides:
      getImplementation in class DittoCborSerializable
      Returns:
      the internal implementation.
    • size

      public int size()
      Returns the number of key-value pairs in this dictionary.
      Returns:
      the dictionary size.
    • isEmpty

      public boolean isEmpty()
      Checks if this dictionary is empty.
      Returns:
      true if the dictionary contains no entries, false otherwise.
    • containsKey

      public boolean containsKey(DittoCborSerializable key)
      Checks if this dictionary contains the specified key.
      Parameters:
      key - the key to check.
      Returns:
      true if the key is present, false otherwise.
    • containsValue

      public boolean containsValue(DittoCborSerializable value)
      Checks if this dictionary contains the specified value.
      Parameters:
      value - the value to check.
      Returns:
      true if the value is present, false otherwise.