Class SetAccessor<T>
java.lang.Object
org.tquadrat.foundation.config.spi.prefs.PreferenceAccessor<Set<T>>
org.tquadrat.foundation.config.spi.prefs.CollectionAccessor<T,Set<T>>
org.tquadrat.foundation.config.spi.prefs.SetAccessor<T>
- Type Parameters:
T- The element type of theSet.
@ClassVersion(sourceVersion="$Id: SetAccessor.java 912 2021-05-06 22:27:04Z tquadrat $")
@API(status=STABLE,
since="0.0.1")
public final class SetAccessor<T>
extends CollectionAccessor<T,Set<T>>
The implementation of
PreferenceAccessor
for instances of
Set.- Note:
-
- This class requires that there is an implementation of
StringConverteravailable for theSet's element type.
- This class requires that there is an implementation of
- Author:
- Thomas Thrien (thomas.thrien@tquadrat.org)
- Version:
- $Id: SetAccessor.java 912 2021-05-06 22:27:04Z tquadrat $
- Since:
- 0.0.1
- UML Diagram
-
UML Diagram for "org.tquadrat.foundation.config.spi.prefs.SetAccessor"
-
Constructor Summary
ConstructorsConstructorDescriptionSetAccessor(String propertyName, StringConverter<T> stringConverter, Getter<Set<T>> getter, Setter<Set<T>> setter) Creates a newSetAccessorinstance. -
Method Summary
Modifier and TypeMethodDescriptioncreateCollection(int size) Creates the collection data structure.Methods inherited from class org.tquadrat.foundation.config.spi.prefs.CollectionAccessor
fromString, readPreference, toString, writePreferenceMethods inherited from class org.tquadrat.foundation.config.spi.prefs.PreferenceAccessor
getPropertyName, getter, hasKey, setter
-
Constructor Details
-
SetAccessor
public SetAccessor(String propertyName, StringConverter<T> stringConverter, Getter<Set<T>> getter, Setter<Set<T>> setter) Creates a newSetAccessorinstance.- Parameters:
propertyName- The name of the property.stringConverter- The implementation ofStringConverterfor theSetelement type.getter- The property getter.setter- The property setter.
-
-
Method Details
-
createCollection
Creates the collection data structure.- Specified by:
createCollectionin classCollectionAccessor<T,Set<T>> - Parameters:
size- The suggested size of the collection; can be ignored if not appropriate.- Returns:
- The collection data structure.
-
