Interface CrudMapAdapter<Key,Value>
- Type Parameters:
Key- Type of the keysValue- Type of the values associated with the keys.
- All Known Implementing Classes:
CrudMapAdapter.Immutable, CrudMapAdapter.SetLike, CrudMapAdapter.SetLike.Immutable, TextFileSystemViewCrudMapAdapter
public interface CrudMapAdapter<Key,Value>
CRUD = create, read, update, and delete
A data adapter with operations for adding, reading, updating, and deleting values indexed by a key. Used by
CrudMap.
- Since:
- 8.2.0
- Author:
- XIMA MEDIA GmbH
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classACrudMapAdapterfor an immutable map.static class -
Method Summary
Modifier and TypeMethodDescriptiondefault intGets the number of values associated with a key.voidRemoves the mapping for the given key.Enumerates all keys for which a mapping may be present.Gets the value for the given key.default booleanisEmpty()Checks whether any keys are associated with a value.voidAssociates a value with the given key.
-
Method Details
-
computeSize
default int computeSize()Gets the number of values associated with a key.The default implementation iterates through each
candidate keyand checks which keys are associated with a value.- Returns:
- The number of existing key-value pairs.
-
delete
Removes the mapping for the given key.- Parameters:
key- Key to disassociate with any values.
-
enumerateCandidateKeys
Enumerates all keys for which a mapping may be present. May include additional keys for which no value is available, seecomputeSize(). Must NOT contain duplicate keys.- Returns:
- A set with all potential keys.
-
get
-
isEmpty
default boolean isEmpty()Checks whether any keys are associated with a value.The default implementation iterates through each
candidate keyand checks if any key is associated with a value.- Returns:
trueif no keys are associated with a value.
-
set
-