Class Setting

java.lang.Object
com.saperion.settings.Setting
All Implemented Interfaces:
Serializable

public class Setting extends Object implements Serializable
A setting that is stored in the database. Just like in an ini-file, a setting is identified by it's name and section, which together must be unique. Both name and section are not case-sensitive. The length of the value of a regular setting is limited to 2KB. A setting with a long value is limited by the maximum size of a CLOB field in the database.
See Also:
  • Constructor Details

    • Setting

      public Setting(String value, String name, String section)
      Creates a new setting.
      Parameters:
      value - the setting's value as a string limited to 2KB
      name - the setting's name as a string limited to 512B
      section - the setting's section as a string limited to 512B
    • Setting

      public Setting(String value, String name, String section, boolean longValue)
      Creates a new setting with a value that can be longer than 2KB if needed.
      Parameters:
      value - the setting's value. If longValue is set to true this can be longer than 2KB. Note that due to performance reasons, long values cannot hold unicode characters. You should encode the value to base64 if needed.
      longValue - if true, the length of the value-string can exceed 2KB
      name - the setting's name as a string limited to 512B
      section - the setting's section as a string limited to 512B
    • Setting

      public Setting(String value, String name, String section, boolean longValue, Date lastModified)
      Creates a new setting with a value that can be longer than 2KB if needed and a timestamp. To be used internally. Note that the last-modified date is set by the server automatically.
      Parameters:
      value - the setting's value. If longValue is set to true this can be longer than 2KB. Note that due to performance reasons, long values cannot hold unicode characters. You should encode the value to base64 if needed.
      longValue - if true, the length of the value-string can exceed 2KB
      name - the setting's name as a string limited to 512B
      section - the setting's section as a string limited to 512B
      lastModified - the date at which this setting was last modified
  • Method Details

    • getValue

      public String getValue()
      Returns:
      the setting's value
    • getName

      public String getName()
      Returns:
      the setting's name
    • getSection

      public String getSection()
      Returns:
      the setting's section
    • setValue

      public void setValue(String value)
      Parameters:
      value - the new value (limited to 2KB)
    • setLongValue

      public void setLongValue(String value)
      Parameters:
      value - the new value. Can be longer than 2KB.
    • isLongSetting

      public boolean isLongSetting()
      Returns:
      whether the value of the setting can be long (>2KB) or not
    • getLastModified

      public Date getLastModified()
      Returns:
      the date at which this setting was modified last
    • toString

      public String toString()
      Overrides:
      toString in class Object
      See Also:
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
      See Also:
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
      See Also: