Class DittoCborSerializable.Dictionary
java.lang.Object
com.ditto.java.serialization.DittoCborSerializable
com.ditto.java.serialization.DittoCborSerializable.Dictionary
- Enclosing class:
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder for constructing CBOR dictionaries.Nested classes/interfaces inherited from class com.ditto.java.serialization.DittoCborSerializable
DittoCborSerializable.Array, DittoCborSerializable.BooleanValue, DittoCborSerializable.ByteString, DittoCborSerializable.Dictionary, DittoCborSerializable.DoubleValue, DittoCborSerializable.FloatValue, DittoCborSerializable.NegativeInteger, DittoCborSerializable.NullValue, DittoCborSerializable.Tagged, DittoCborSerializable.UnsignedInteger, DittoCborSerializable.Utf8String -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if this dictionary contains the specified key.booleanChecks if this dictionary contains the specified value.protected @NonNull com.ditto.internal.serialization.InternalDittoCborSerializable.DictionaryReturns the internal CBOR serializable implementation.booleanisEmpty()Checks if this dictionary is empty.intsize()Returns the number of key-value pairs in this dictionary.Methods inherited from class com.ditto.java.serialization.DittoCborSerializable
asAttachmentToken, asAttachmentTokenOrNull, asBigInteger, asBigIntegerOrNull, asBoolean, asBooleanOrNull, asByte, asByteOrNull, asDictionary, asDictionaryOrNull, asDouble, asDoubleOrNull, asFloat, asFloatOrNull, asInt, asIntOrNull, asList, asListOrNull, asLong, asLongOrNull, asNullableBigInteger, asNullableBoolean, asNullableByte, asNullableDictionary, asNullableDouble, asNullableFloat, asNullableInt, asNullableList, asNullableLong, asNullableShort, asNullableString, asNullableTagged, asNullableUnsignedByte, asNullableUnsignedInt, asNullableUnsignedLong, asNullableUnsignedShort, asShort, asShortOrNull, asString, asStringOrNull, asTagged, asTaggedOrNull, asUnsignedByte, asUnsignedByteOrNull, asUnsignedInt, asUnsignedIntOrNull, asUnsignedLong, asUnsignedLongOrNull, asUnsignedShort, asUnsignedShortOrNull, buildArray, buildDictionary, equals, get, get, get, hashCode, isNull, nullValue, of, of, of, of, of, of, of, of, of, of, tagged, toString
-
Method Details
-
getImplementation
protected @NonNull com.ditto.internal.serialization.InternalDittoCborSerializable.Dictionary getImplementation()Description copied from class:DittoCborSerializableReturns the internal CBOR serializable implementation.- Overrides:
getImplementationin classDittoCborSerializable- 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:
trueif the dictionary contains no entries,falseotherwise.
-
containsKey
Checks if this dictionary contains the specified key.- Parameters:
key- the key to check.- Returns:
trueif the key is present,falseotherwise.
-
containsValue
Checks if this dictionary contains the specified value.- Parameters:
value- the value to check.- Returns:
trueif the value is present,falseotherwise.
-