Package org.n52.faroe
Class AbstractSettingDefinition<T>
java.lang.Object
org.n52.faroe.AbstractOrdered
org.n52.faroe.AbstractSettingDefinition<T>
- Type Parameters:
T- the type of the value
- All Implemented Interfaces:
Serializable,Comparable<Ordered>,Ordered,SettingDefinition<T>
- Direct Known Subclasses:
BooleanSettingDefinition,ChoiceSettingDefinition,DateTimeSettingDefinition,FileSettingDefinition,IntegerSettingDefinition,MultilingualStringSettingDefinition,NumericSettingDefinition,StringSettingDefinition,UriSettingDefinition
public abstract class AbstractSettingDefinition<T>
extends AbstractOrdered
implements SettingDefinition<T>, Serializable
Generic implementation of
SettingDefinition.- Since:
- 1.0.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetGroup()getKey()protected StringgetTitle()getType()booleanbooleanbooleanhasGroup()inthashCode()protected booleanbooleanhasTitle()booleansetDefaultValue(T d) Sets the default value of this setting.Sets the description of this setting definition, which should further describe the purpose of this setting.Sets the group of this definition.Sets the unique identifier of this setting definition, which can be referenced by configurable classes.setOptional(boolean o) Sets whether this setting is optional or can be null.Sets the title of this setting definition, which will be presented to the user.(package private) AbstractSettingDefinition<T> setType(SettingType type) toString()Methods inherited from class org.n52.faroe.AbstractOrdered
compareTo, getOrder, setOrderMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface org.n52.faroe.SettingDefinition
getGroup, getOptionalDefaultValue
-
Constructor Details
-
AbstractSettingDefinition
- Parameters:
type- theSettingTypeof this setting definition
-
-
Method Details
-
getKey
- Specified by:
getKeyin interfaceSettingDefinition<T>- Returns:
- the unique key of this definition
-
setKey
Description copied from interface:SettingDefinitionSets the unique identifier of this setting definition, which can be referenced by configurable classes.- Specified by:
setKeyin interfaceSettingDefinition<T>- Parameters:
k- the unique key
-
getDescription
- Specified by:
getDescriptionin interfaceSettingDefinition<T>- Returns:
- the description of this definition
-
setDescription
Description copied from interface:SettingDefinitionSets the description of this setting definition, which should further describe the purpose of this setting. Can contain XHTML markup.- Specified by:
setDescriptionin interfaceSettingDefinition<T>- Parameters:
d- the description
-
hasDescription
public boolean hasDescription()- Specified by:
hasDescriptionin interfaceSettingDefinition<T>- Returns:
- if this definition has a non empty description
-
getTitle
- Specified by:
getTitlein interfaceSettingDefinition<T>- Returns:
- the title of this definition
-
setTitle
Description copied from interface:SettingDefinitionSets the title of this setting definition, which will be presented to the user.- Specified by:
setTitlein interfaceSettingDefinition<T>- Parameters:
t- the title
-
hasTitle
public boolean hasTitle()- Specified by:
hasTitlein interfaceSettingDefinition<T>- Returns:
- if this definition has a non empty title
-
isOptional
public boolean isOptional()- Specified by:
isOptionalin interfaceSettingDefinition<T>- Returns:
- wether this setting is optional or required.
-
setOptional
Description copied from interface:SettingDefinitionSets whether this setting is optional or can be null. By default all settings are required.- Specified by:
setOptionalin interfaceSettingDefinition<T>- Parameters:
o- if this setting is optional
-
getGroup
- Specified by:
getGroupin interfaceSettingDefinition<T>- Returns:
- the group of this definition
-
setGroup
Description copied from interface:SettingDefinitionSets the group of this definition. If no group is set, the setting will be moved to a default group.- Specified by:
setGroupin interfaceSettingDefinition<T>- Parameters:
g- the group
-
hasGroup
public boolean hasGroup()- Specified by:
hasGroupin interfaceSettingDefinition<T>- Returns:
- if this definition has a group
-
getDefaultValue
- Specified by:
getDefaultValuein interfaceSettingDefinition<T>- Returns:
- the default value (or null if there is none)
-
setDefaultValue
Description copied from interface:SettingDefinitionSets the default value of this setting. All required settings should have a default setting to allow a smoother integration of new settings in old configurations.- Specified by:
setDefaultValuein interfaceSettingDefinition<T>- Parameters:
d- the default value
-
hasDefaultValue
public boolean hasDefaultValue()- Specified by:
hasDefaultValuein interfaceSettingDefinition<T>- Returns:
- if this definition has a default value
-
hasStringProperty
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractOrdered
-
equals
- Overrides:
equalsin classAbstractOrdered
-
toString
-
getType
- Specified by:
getTypein interfaceSettingDefinition<T>- Returns:
- the type of the value of this definition
-
setType
-
getSuborder
- Specified by:
getSuborderin classAbstractOrdered
-