Class CrudMapAdapter.SetLike<Value>
java.lang.Object
de.xima.fc.common.collection.CrudMapAdapter.SetLike<Value>
- Type Parameters:
Value- Type of the values in the set.
- All Implemented Interfaces:
CrudMapAdapter<Value,Unit>, Serializable
- Direct Known Subclasses:
CrudMapAdapter.SetLike.Immutable
- Enclosing interface:
CrudMapAdapter<Key,Value>
public abstract static class CrudMapAdapter.SetLike<Value>
extends Object
implements CrudMapAdapter<Value,Unit>, Serializable
A
CrudMapAdapter with a Unit whose presence corresponds to whether the key is present in a
Set. Intended to be used e.g. with CrudMap.newSet().
Implements CrudMapAdapter#get by checking whether the key is present, and
set by delegating to either delete or
add.- Since:
- 8.2.0
- Author:
- XIMA MEDIA GmbH
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface CrudMapAdapter
CrudMapAdapter.SetLike<Value> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidAdds a given value to the set.protected abstract booleanChecks whether the set contains the given value.final UnitGets the value for the given key.final voidAssociates a value with the given key.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface CrudMapAdapter
computeSize, delete, enumerateCandidateKeys, isEmpty
-
Constructor Details
-
SetLike
public SetLike()
-
-
Method Details
-
get
Description copied from interface:CrudMapAdapterGets the value for the given key. Returnsnullwhen no value is available for the key.- Specified by:
getin interfaceCrudMapAdapter<Value,Unit> - Parameters:
key- Key to access.- Returns:
- The value associated with the key, or
nullwhen no value is associated with the key.
-
set
Description copied from interface:CrudMapAdapterAssociates a value with the given key.- Specified by:
setin interfaceCrudMapAdapter<Value,Unit> - Parameters:
key- Key to associate with a different value.unit- Value to associate with the key, nevernull.
-
add
Adds a given value to the set.- Parameters:
value- Value to add.
-
contains
Checks whether the set contains the given value.- Parameters:
value- Value to check.- Returns:
- Whether the set contains the value.
-