Class BaseKeyedSettingSpecifier<T>
java.lang.Object
net.solarnetwork.settings.support.BaseSettingSpecifier
net.solarnetwork.settings.support.BaseKeyedSettingSpecifier<T>
- All Implemented Interfaces:
KeyedSettingSpecifier<T>,MappableSpecifier,SettingSpecifier
- Direct Known Subclasses:
BasicSliderSettingSpecifier,BasicTextAreaSettingSpecifier,BasicTitleSettingSpecifier,BasicToggleSettingSpecifier
public abstract class BaseKeyedSettingSpecifier<T>
extends BaseSettingSpecifier
implements KeyedSettingSpecifier<T>
Base implementation of
KeyedSettingSpecifier.- Version:
- 1.0
- Author:
- matt
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.solarnetwork.settings.MappableSpecifier
MappableSpecifier.Mapper -
Constructor Summary
ConstructorsConstructorDescriptionBaseKeyedSettingSpecifier(String key, T defaultValue) Constructor.BaseKeyedSettingSpecifier(String key, T defaultValue, boolean trans) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionGet the default value for this setting.Object[]Get an optional list of message arguments to use when rendering a description of this specifier.getKey()Get the key for this setting.booleanGet transient flag.Return a setting specifier mapped to a new path.voidsetDefaultValue(T defaultValue) voidsetDescriptionArguments(Object[] descriptionArguments) Set the optional description arguments.voidvoidsetTransient(boolean value) toString()Methods inherited from class net.solarnetwork.settings.support.BaseSettingSpecifier
getTitle, getType, setTitleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.solarnetwork.settings.MappableSpecifier
mappedWithMapper, mappedWithPlaceholerMethods inherited from interface net.solarnetwork.settings.SettingSpecifier
getTitle, getType
-
Constructor Details
-
BaseKeyedSettingSpecifier
Constructor.The
transientproperty will be set to false- Parameters:
key- the keydefaultValue- the default value
-
BaseKeyedSettingSpecifier
Constructor.- Parameters:
key- the keydefaultValue- the default valuetrans- the transient flag value
-
-
Method Details
-
getKey
Description copied from interface:KeyedSettingSpecifierGet the key for this setting.- Specified by:
getKeyin interfaceKeyedSettingSpecifier<T>- Returns:
- the key to associate with this setting
-
getDefaultValue
Description copied from interface:KeyedSettingSpecifierGet the default value for this setting.- Specified by:
getDefaultValuein interfaceKeyedSettingSpecifier<T>- Returns:
- the default value
-
isTransient
public boolean isTransient()Description copied from interface:KeyedSettingSpecifierGet transient flag.If a setting is transient, its associated value is never actually persisted and the
KeyedSettingSpecifier.getDefaultValue()is treated as its "current" value. This can be used for- Specified by:
isTransientin interfaceKeyedSettingSpecifier<T>- Returns:
- true if the setting is transient
-
mappedTo
Description copied from interface:MappableSpecifierReturn a setting specifier mapped to a new path.This is to allow delegating setting specifiers to re-map the key.
- Specified by:
mappedToin interfaceMappableSpecifier- Parameters:
prefix- the new prefix to add to the key- Returns:
- the new instance
-
toString
-
setTransient
public void setTransient(boolean value) -
setKey
-
setDefaultValue
-
setDescriptionArguments
Set the optional description arguments.- Parameters:
descriptionArguments- The arguments to set.- Since:
- 1.2
-
getDescriptionArguments
Description copied from interface:KeyedSettingSpecifierGet an optional list of message arguments to use when rendering a description of this specifier.- Specified by:
getDescriptionArgumentsin interfaceKeyedSettingSpecifier<T>- Returns:
- An optional list of message arguments.
-