Interface SystemPropertyOperations

All Known Implementing Classes:
SystemProperties

public interface SystemPropertyOperations
Java enum type does not support inheritance. This interface provides implementations to handle SystemProperties in a uniform way enabling modules to define their SystemProperties independently.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final org.slf4j.Logger
    This logger name is made unusual to avoid the problem when this interface is used in SystemProperty enums.
  • Method Summary

    Modifier and Type
    Method
    Description
    default String
    getActualName(Object... nameArgs)
    Retrieve the actual name of the SystemProperty.
    default Boolean
     
    default Boolean
    getBoolean(Boolean defaultOverwrite)
     
    default Boolean
    getBoolean(Boolean defaultOverwrite, Object... args)
    Retrieve the value of the SystemProperty as Boolean covering all the cases.
    default Boolean
    getBoolean(Object... args)
    Retrieve the value of the SystemProperty as Boolean for cases when the name of the SystemProperty is the combination of a predefined String and input string(s) required to configure the actual functionality.
     
    default Object
    getInstance(Object... nameArgs)
    Retrieve the value of the SystemProperty as String and try to instantiate the resulting String using Class.forName(String).
    default Integer
     
    default Integer
    getInteger(Integer defaultOverwrite)
     
    default Integer
    getInteger(Integer defaultOverwrite, Object... args)
    Retrieve the value of the SystemProperty as Integer covering all the cases.
    default Integer
    getInteger(Object... args)
    Retrieve the value of the SystemProperty as Integer for cases when the name of the SystemProperty is the combination of a predefined String and input string(s) required to configure the actual functionality.
    default Object
     
    default Object
    getObject(Object defaultOverwrite)
     
    default Object
    getObject(Object... nameArgs)
    Retrieve the value of the SystemProperty as Object for cases when the name of the SystemProperty is the combination of a predefined String and input string(s) required to configure the actual functionality.
    default Object
    getObject(Object defaultOverwrite, Object... nameArgs)
    Retrieve the value of the SystemProperty as Object covering all the cases.
    default String
     
    default String
    getString(Object... nameArgs)
    Retrieve the value of the SystemProperty as String (trimmed) for cases when the name of the SystemProperty is the combination of a predefined String and input string(s) required to configure the actual functionality.
    default String
    getString(String defaultOverwrite)
     
    default String
    getString(String defaultOverwrite, Object... nameArgs)
    Retrieve the value of the SystemProperty as String (trimmed) covering all the cases.
     
    default Object
    set(Object value)
    Set the value of the SystemProperty maintained.
    default Object
    set(Properties props, Object value)
    Set the value in the given Properties object using the SystemProperty name.
  • Field Details

    • enumLogger

      static final org.slf4j.Logger enumLogger
      This logger name is made unusual to avoid the problem when this interface is used in SystemProperty enums. When all the values of such SystemProperty is statically imported, the log variable will be imported as well. This will somehow supersede the log variable declared of the importing class.
  • Method Details

    • getSystemPropertyName

      String getSystemPropertyName()
      Returns:
      the String name of the SystemProperty, e.g. 'ItemServer.Telnet.host'
    • getDefaultValue

      Object getDefaultValue()
      Returns:
      the default value of the actual SystemPoperty, can be null.
    • getActualName

      default String getActualName(Object... nameArgs)
      Retrieve the actual name of the SystemProperty. It is used for those SystemProperty names, which are based on String.format(String, Object...)
      Parameters:
      nameArgs - array of Strings to be used in String.format(String, Object...) to retrieve the actual name of the SystemProperty
      Returns:
      actual name of the SystemProperty
    • getObject

      default Object getObject()
      Returns:
      the value of the SystemProperty as Object. If no value is provided return the configured default value if available otherwise return null.
    • getObject

      default Object getObject(Object defaultOverwrite)
      Parameters:
      defaultOverwrite - Use this value as default. Overwrites the default value defined in the enum. Can be null.
      Returns:
      the value of the SystemProperty as Object. If no value is provided return the provided default value or configured default value if available otherwise return null
    • getObject

      default Object getObject(Object... nameArgs)
      Retrieve the value of the SystemProperty as Object for cases when the name of the SystemProperty is the combination of a predefined String and input string(s) required to configure the actual functionality.
      To support this the SystemProperty name is based on String.format(String, Object...) i.e. it contains string like 'OutcomeInit.%s'.
      Parameters:
      nameArgs - array of Strings to be used in String.format(String, Object...). to retrieve the actual name of the SystemProperty. Can be null.
      Returns:
      the value of the SystemProperty as Object. If no value is provided return configured default value if available otherwise return null
    • getObject

      default Object getObject(Object defaultOverwrite, Object... nameArgs)
      Retrieve the value of the SystemProperty as Object covering all the cases. It can retrieve the value associated with the SystemProperty name or it can retrieve the value when the name of the SystemProperty is the combination of a predefined String and input string(s) required to configure the actual functionality.
      To support this the SystemProperty name is based on String.format(String, Object...) i.e. it contains string like 'OutcomeInit.%s'.
      Parameters:
      defaultOverwrite - Use this value as default. Overwrites the default value defined in the enum. Can be null.
      nameArgs - array of Strings to be used in String.format(String, Object...) to retrieve the actual name of the SystemProperty. Can be null.
      Returns:
      the value of the SystemProperty as Object. If no value is provided return configured default value if available otherwise return null
    • getString

      default String getString()
      Returns:
      the value of the SystemProperty as String (trimmed). If no value is provided return the configured default value if available otherwise return null.
    • getString

      default String getString(String defaultOverwrite)
      Parameters:
      defaultOverwrite - Use this value as default. Overwrites the default value defined in the enum. Can be null.
      Returns:
      the value of the SystemProperty as String (trimmed). If no value is provided return the provided default value or configured default value if available otherwise return null.
    • getString

      default String getString(Object... nameArgs)
      Retrieve the value of the SystemProperty as String (trimmed) for cases when the name of the SystemProperty is the combination of a predefined String and input string(s) required to configure the actual functionality.
      To support this the SystemProperty name is based on String.format(String, Object...) i.e. it contains string like 'OutcomeInit.%s'.
      Parameters:
      nameArgs - array of Strings to be used in String.format(String, Object...). to retrieve the actual name of the SystemProperty. Can be null.
      Returns:
      the value of the SystemProperty as String (trimmed). If no value is provided return configured default value if available otherwise return null
    • getString

      default String getString(String defaultOverwrite, Object... nameArgs)
      Retrieve the value of the SystemProperty as String (trimmed) covering all the cases. It can retrieve the value associated with the SystemProperty name or it can retrieve the value when the name of the SystemProperty is the combination of a predefined String and input string(s) required to configure the actual functionality.
      To support this the SystemProperty name is based on String.format(String, Object...) i.e. it contains string like 'OutcomeInit.%s'.
      Parameters:
      defaultOverwrite - Use this value as default. Overwrites the default value defined in the enum. Can be null.
      nameArgs - array of Strings to be used in String.format(String, Object...) to retrieve the actual name of the SystemProperty. Can be null.
      Returns:
      the value of the SystemProperty as String (trimmed). If no value is provided return configured default value if available otherwise return null.
    • getInteger

      default Integer getInteger()
      Returns:
      the value of the SystemProperty as Integer. If no value is provided return the configured default value if available otherwise return null.
    • getInteger

      default Integer getInteger(Integer defaultOverwrite)
      Parameters:
      defaultOverwrite - Use this value as default. Overwrites the default value defined in the enum
      Returns:
      the value of the SystemProperty as Integer. If no value is provided return the provided default value or configured default value if available otherwise return null.
    • getInteger

      default Integer getInteger(Object... args)
      Retrieve the value of the SystemProperty as Integer for cases when the name of the SystemProperty is the combination of a predefined String and input string(s) required to configure the actual functionality.
      To support this the SystemProperty name is based on String.format(String, Object...) i.e. it contains string like 'OutcomeInit.%s'.
      Parameters:
      nameArgs - array of Strings to be used in String.format(String, Object...). to retrieve the actual name of the SystemProperty. Can be null.
      Returns:
      the value of the SystemProperty as Integer. If no value is provided return configured default value if available otherwise return null
    • getInteger

      default Integer getInteger(Integer defaultOverwrite, Object... args)
      Retrieve the value of the SystemProperty as Integer covering all the cases. It can retrieve the value associated with the SystemProperty name or it can retrieve the value when the name of the SystemProperty is the combination of a predefined String and input string(s) required to configure the actual functionality.
      To support this the SystemProperty name is based on String.format(String, Object...) i.e. it contains string like 'OutcomeInit.%s'.
      Parameters:
      defaultOverwrite - Use this value as default. Overwrites the default value defined in the enum. Can be null.
      nameArgs - array of Strings to be used in String.format(String, Object...) to retrieve the actual name of the SystemProperty. Can be null.
      Returns:
      the value of the SystemProperty as Integer. If no value is provided return configured default value if available otherwise return null
    • getBoolean

      default Boolean getBoolean()
      Returns:
      the value of the SystemProperty as Boolean. If no value is provided return the configured default value if available otherwise return null.
    • getBoolean

      default Boolean getBoolean(Boolean defaultOverwrite)
      Parameters:
      defaultOverwrite - Use this value as default. Overwrites the default value defined in the enum
      Returns:
      the value of the SystemProperty as Boolean. If no value is provided return the provided default value or configured default value if available otherwise return null.
    • getBoolean

      default Boolean getBoolean(Object... args)
      Retrieve the value of the SystemProperty as Boolean for cases when the name of the SystemProperty is the combination of a predefined String and input string(s) required to configure the actual functionality.
      To support this the SystemProperty name is based on String.format(String, Object...) i.e. it contains string like 'OutcomeInit.%s'.
      Parameters:
      nameArgs - array of Strings to be used in String.format(String, Object...). to retrieve the actual name of the SystemProperty. Can be null.
      Returns:
      the value of the SystemProperty as Boolean. If no value is provided return configured default value if available otherwise return null
    • getBoolean

      default Boolean getBoolean(Boolean defaultOverwrite, Object... args)
      Retrieve the value of the SystemProperty as Boolean covering all the cases. It can retrieve the value associated with the SystemProperty name or it can retrieve the value when the name of the SystemProperty is the combination of a predefined String and input string(s) required to configure the actual functionality.
      To support this the SystemProperty name is based on String.format(String, Object...) i.e. it contains string like 'OutcomeInit.%s'.
      Parameters:
      defaultOverwrite - Use this value as default. Overwrites the default value defined in the enum. Can be null.
      nameArgs - array of Strings to be used in String.format(String, Object...) to retrieve the actual name of the SystemProperty. Can be null.
      Returns:
      the value of the SystemProperty as Boolean. If no value is provided return configured default value if available otherwise return null
    • getInstance

      default Object getInstance(Object... nameArgs) throws ReflectiveOperationException
      Retrieve the value of the SystemProperty as String and try to instantiate the resulting String using Class.forName(String). It covers cases when the name of the SystemProperty is the combination of a predefined String and input string(s) required to configure the actual functionality.
      To support this the SystemProperty name is based on String.format(String, Object...) i.e. it contains string like 'OutcomeInit.%s'.
      Parameters:
      nameArgs - array of Strings to be used in String.format(String, Object...). to retrieve the actual name of the SystemProperty. Can be null.
      Returns:
      the value of the SystemProperty as in instance of the Class.
      Throws:
      ReflectiveOperationException - No value was available for the SystemProperty.
    • set

      default Object set(Object value)
      Set the value of the SystemProperty maintained.
      Parameters:
      value - of the SystemProperty
      Returns:
      the previous value associated with SystemProperty, or null if there was no mapping for SystemProperty.
    • set

      default Object set(Properties props, Object value)
      Set the value in the given Properties object using the SystemProperty name.
      Parameters:
      props - the properties object to be updated
      value - of the SystemProperty
      Returns:
      the previous value associated with SystemProperty, or null if there was no mapping for SystemProperty.