Package org.n52.faroe
Interface SettingDefinition<T>
- Type Parameters:
T- The type of the value
- All Superinterfaces:
Comparable<Ordered>,Ordered,Serializable
- All Known Implementing Classes:
AbstractSettingDefinition,BooleanSettingDefinition,ChoiceSettingDefinition,DateTimeSettingDefinition,FileSettingDefinition,IntegerSettingDefinition,MultilingualStringSettingDefinition,NumericSettingDefinition,StringSettingDefinition,UriSettingDefinition
Interface for setting definitions that can be used within the Service. Defined settings will be presented in the
administrator and installer view.
- Since:
- 1.0.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiongetGroup()default SettingDefinitionGroupgetGroup(SettingDefinitionGroup defaultGroup) getKey()getTitle()getType()booleanbooleanbooleanhasGroup()booleanhasTitle()booleansetDefaultValue(T defaultValue) Sets the default value of this setting.setDescription(String description) Sets the description of this setting definition, which should further describe the purpose of this setting.setGroup(SettingDefinitionGroup group) Sets the group of this definition.Sets the unique identifier of this setting definition, which can be referenced by configurable classes.setOptional(boolean optional) Sets whether this setting is optional or can be null.Sets the title of this setting definition, which will be presented to the user.Methods inherited from interface java.lang.Comparable
compareTo
-
Method Details
-
getKey
String getKey()- Returns:
- the unique key of this definition
-
getTitle
String getTitle()- Returns:
- the title of this definition
-
getDescription
String getDescription()- Returns:
- the description of this definition
-
isOptional
boolean isOptional()- Returns:
- wether this setting is optional or required.
-
getDefaultValue
T getDefaultValue()- Returns:
- the default value (or null if there is none)
-
getOptionalDefaultValue
-
getGroup
SettingDefinitionGroup getGroup()- Returns:
- the group of this definition
-
getGroup
-
hasTitle
boolean hasTitle()- Returns:
- if this definition has a non empty title
-
hasDescription
boolean hasDescription()- Returns:
- if this definition has a non empty description
-
hasDefaultValue
boolean hasDefaultValue()- Returns:
- if this definition has a default value
-
hasGroup
boolean hasGroup()- Returns:
- if this definition has a group
-
setKey
Sets the unique identifier of this setting definition, which can be referenced by configurable classes.- Parameters:
key- the unique key
-
setTitle
Sets the title of this setting definition, which will be presented to the user.- Parameters:
title- the title
-
setDescription
Sets the description of this setting definition, which should further describe the purpose of this setting. Can contain XHTML markup.- Parameters:
description- the description
-
setOptional
Sets whether this setting is optional or can be null. By default all settings are required.- Parameters:
optional- if this setting is optional
-
setDefaultValue
Sets 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.- Parameters:
defaultValue- the default value
-
setGroup
Sets the group of this definition. If no group is set, the setting will be moved to a default group.- Parameters:
group- the group
-
getType
SettingType getType()- Returns:
- the type of the value of this definition
-