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
public interface SettingDefinition<T> extends Ordered, Serializable
Interface for setting definitions that can be used within the Service. Defined settings will be presented in the administrator and installer view.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description TgetDefaultValue()StringgetDescription()SettingDefinitionGroupgetGroup()default SettingDefinitionGroupgetGroup(SettingDefinitionGroup defaultGroup)StringgetKey()default Optional<T>getOptionalDefaultValue()StringgetTitle()SettingTypegetType()booleanhasDefaultValue()booleanhasDescription()booleanhasGroup()booleanhasTitle()booleanisOptional()SettingDefinition<?>setDefaultValue(T defaultValue)Sets the default value of this setting.SettingDefinition<?>setDescription(String description)Sets the description of this setting definition, which should further describe the purpose of this setting.SettingDefinition<?>setGroup(SettingDefinitionGroup group)Sets the group of this definition.SettingDefinition<?>setKey(String key)Sets the unique identifier of this setting definition, which can be referenced by configurable classes.SettingDefinition<?>setOptional(boolean optional)Sets whether this setting is optional or can be null.SettingDefinition<?>setTitle(String title)Sets the title of this setting definition, which will be presented to the user.-
Methods inherited from interface java.lang.Comparable
compareTo
-
-
-
-
Method Detail
-
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)
-
getGroup
SettingDefinitionGroup getGroup()
- Returns:
- the group of this definition
-
getGroup
default SettingDefinitionGroup getGroup(SettingDefinitionGroup defaultGroup)
-
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
SettingDefinition<?> setKey(String key)
Sets the unique identifier of this setting definition, which can be referenced by configurable classes.- Parameters:
key- the unique key
-
setTitle
SettingDefinition<?> setTitle(String title)
Sets the title of this setting definition, which will be presented to the user.- Parameters:
title- the title
-
setDescription
SettingDefinition<?> setDescription(String description)
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
SettingDefinition<?> setOptional(boolean optional)
Sets whether this setting is optional or can be null. By default all settings are required.- Parameters:
optional- if this setting is optional
-
setDefaultValue
SettingDefinition<?> setDefaultValue(T defaultValue)
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
SettingDefinition<?> setGroup(SettingDefinitionGroup group)
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
-
-