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.
Since:
1.0.0
See Also:
  • 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

      default Optional<T> getOptionalDefaultValue()
    • 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

      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