Class PrimitiveIntAccessor
java.lang.Object
org.tquadrat.foundation.config.spi.prefs.PreferenceAccessor<Integer>
org.tquadrat.foundation.config.spi.prefs.PrimitiveIntAccessor
@ClassVersion(sourceVersion="$Id: PrimitiveIntAccessor.java 914 2021-05-07 21:22:12Z tquadrat $")
@API(status=STABLE,
since="0.0.1")
public final class PrimitiveIntAccessor
extends PreferenceAccessor<Integer>
The implementation of
PreferenceAccessor
for int.
This differs from
IntegerAccessor
as it forces 0 (zero) as the default value, while the other
implementation has null as the default value.
- Author:
- Thomas Thrien (thomas.thrien@tquadrat.org)
- Version:
- $Id: PrimitiveIntAccessor.java 914 2021-05-07 21:22:12Z tquadrat $
- Since:
- 0.0.1
- UML Diagram
-
UML Diagram for "org.tquadrat.foundation.config.spi.prefs.PrimitiveIntAccessor"
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidreadPreference(Preferences node) Reads the preference value from the given node and writes it to the property.final voidwritePreference(Preferences node) Writes the preference value from the property and writes it to the given node.Methods inherited from class org.tquadrat.foundation.config.spi.prefs.PreferenceAccessor
getPropertyName, getter, hasKey, setter
-
Constructor Details
-
PrimitiveIntAccessor
Creates a newPrimitiveIntAccessorinstance.- Parameters:
propertyName- The name of the property.getter- The property getter.setter- The property setter.
-
-
Method Details
-
readPreference
Reads the preference value from the given node and writes it to the property.- Specified by:
readPreferencein classPreferenceAccessor<Integer>- Parameters:
node- The preference node.- Throws:
InvalidPreferenceValueException- The preferences value cannot be translated to the property type.
-
writePreference
Writes the preference value from the property and writes it to the given node.- Specified by:
writePreferencein classPreferenceAccessor<Integer>- Parameters:
node- The preference node.
-
