Package org.openjdk.jmc.common.util
Class TypedPreference<T>
- java.lang.Object
-
- org.openjdk.jmc.common.util.TypedPreference<T>
-
- Type Parameters:
T- the type of the value
public class TypedPreference<T> extends Object
A preference key with a default value. Note that the configured value is not stored in the preference. Instead anIPreferenceValueProvideris used to get values.
-
-
Constructor Summary
Constructors Constructor Description TypedPreference(String identifier, String name, String description, IPersister<T> persister, T defaultValue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)TgetDefaultValue()StringgetDescription()StringgetIdentifier()StringgetName()IPersister<T>getPersister()Get a persister that can be used to convert between the preference value type and strings.inthashCode()StringtoString()
-
-
-
Constructor Detail
-
TypedPreference
public TypedPreference(String identifier, String name, String description, IPersister<T> persister, T defaultValue)
- Parameters:
identifier- preference identifiername- preference namedescription- a longer description of the preferencepersister- a persister that can parse and format valuesdefaultValue- if a value for this preference has not been set, then use this default value
-
-
Method Detail
-
getIdentifier
public String getIdentifier()
- Returns:
- preference identifier
-
getName
public String getName()
- Returns:
- preference name
-
getDescription
public String getDescription()
- Returns:
- preference description
-
getPersister
public IPersister<T> getPersister()
Get a persister that can be used to convert between the preference value type and strings.- Returns:
- value persister
-
getDefaultValue
public T getDefaultValue()
- Returns:
- the default value for this preference
-
-