Interface Configuration

All Superinterfaces:
Serializable
All Known Subinterfaces:
ActivityConfiguration, ChangeableActivityConfiguration, ChangeableConfiguration, MergingActivityConfiguration, MergingConfiguration

public interface Configuration extends Serializable
A configuration object provides the means to access configuration values type-safe. Valid data types are the Java equivalents of the usual ProcessConstants.AdeptDataTypes. Each configuration belongs to a ConfigurationDescription, that provides more information on a configuration value. This includes the type, restrictions and a description. The configuration description can be retrieved from the entity that provided this configuration.

Since a text-based file is a common representation of a configuration, all values may be retrieved as string. However, this interface allows type-safe access and thus encapsulates parsing. If the parsing fails, null will be returned (except for getString(String)).
Besides an invalid value type, null will also be returned if no appropriate configuration value is present. This also excludes getString(String) which may return the empty string or null instead.
A string value may either be empty or null. Null corresponds to a non-present configuration entry (similar to a map not having a specific key). The empty string represents a present configuration entry having no defined value (similar to a map having a key without value).

Author:
Ulrich Kreher
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
    The IDs for configurations, see getConfigurationID(String).
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final long
    Generated ID for serialisation.
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets all entry names that have a value different from null in this configuration.
    getBoolean(String entryName)
    Gets the boolean configuration value provided under the designated entry name or null if the value is not present or cannot be parsed to a boolean value.
    Gets the ID of the configuration object, the designated entry name stems from.
    getDate(String entryName)
    Gets the Date configuration value provided under the designated entry name or null if the value is not present or cannot be parsed to a Date value.
    getFloat(String entryName)
    Gets the float configuration value provided under the designated entry name or null if the value is not present or cannot be parsed to a double value.
    getInteger(String entryName)
    Gets the integer configuration value provided under the designated entry name or null if the value is not present or cannot be parsed to a long value.
    getString(String entryName)
    Gets the configuration value provided under the designated entry name as string which will always work even if the designated entry has another type.
    byte[]
    getUDT(String entryName)
    Gets the UDTValue configuration value provided under the designated entry name or null if the value is not present or cannot be parsed to a byte[] value.
    getURI(String entryName)
    Gets the URI configuration value provided under the designated entry name or null if the value is not present or cannot be parsed to a URI value.
    boolean
    isFixed(String entryName)
    Gets whether the configuration value provided under the designated entry name can not be changed either be explicitly setting the value or overriding it.
  • Field Details

    • serialVersionUID

      static final long serialVersionUID
      Generated ID for serialisation.
      See Also:
  • Method Details

    • getBoolean

      Boolean getBoolean(String entryName)
      Gets the boolean configuration value provided under the designated entry name or null if the value is not present or cannot be parsed to a boolean value.
      Parameters:
      entryName - The name of the entry for which to retrieve the boolean value of.
      Returns:
      A boolean configuration value for the designated entry or null in case the value is not present or cannot be parsed to a boolean value.
    • getInteger

      Long getInteger(String entryName)
      Gets the integer configuration value provided under the designated entry name or null if the value is not present or cannot be parsed to a long value.
      Parameters:
      entryName - The name of the entry for which to retrieve the long value of.
      Returns:
      A long configuration value for the designated entry or null in case the value is not present or cannot be parsed to a long value.
    • getFloat

      Double getFloat(String entryName)
      Gets the float configuration value provided under the designated entry name or null if the value is not present or cannot be parsed to a double value.
      Parameters:
      entryName - The name of the entry for which to retrieve the double value of.
      Returns:
      A double configuration value for the designated entry or null in case the value is not present or cannot be parsed to a double value.
    • getString

      String getString(String entryName)
      Gets the configuration value provided under the designated entry name as string which will always work even if the designated entry has another type. If the value is not present, null will be returned. The value may also be the empty string which will be interpreted as null in type-safe access methods.
      Parameters:
      entryName - The name of the entry for which to retrieve the string representation of the configuration value of.
      Returns:
      A (string representation of the) configuration value for the designated entry or null in case the value is not present.
    • getURI

      URI getURI(String entryName)
      Gets the URI configuration value provided under the designated entry name or null if the value is not present or cannot be parsed to a URI value.
      Parameters:
      entryName - The name of the entry for which to retrieve the URI value of.
      Returns:
      A URI configuration value for the designated entry or null in case the value is not present or cannot be parsed to a URI value.
    • getDate

      Date getDate(String entryName)
      Gets the Date configuration value provided under the designated entry name or null if the value is not present or cannot be parsed to a Date value.
      Parameters:
      entryName - The name of the entry for which to retrieve the Date value of.
      Returns:
      A Date configuration value for the designated entry or null in case the value is not present or cannot be parsed to a Date value.
    • getUDT

      byte[] getUDT(String entryName)
      Gets the UDTValue configuration value provided under the designated entry name or null if the value is not present or cannot be parsed to a byte[] value.
      Parameters:
      entryName - The name for the entry for which to retrieve the byte[] value of.
      Returns:
      A byte[] configuration value for the designated entry or null in case the value is not present or cannot be parsed to a byte[] value.
    • isFixed

      boolean isFixed(String entryName)
      Gets whether the configuration value provided under the designated entry name can not be changed either be explicitly setting the value or overriding it.
      Parameters:
      entryName - The name for the entry for which to retrieve whether the configuration value must not be changed.
      Returns:
      Whether the configuration value for the designated entry must not be changed.
    • getAllEntries

      Set<String> getAllEntries()
      Gets all entry names that have a value different from null in this configuration.
      Returns:
      All entry names that have a value different from null in this configuration.
    • getConfigurationID

      String getConfigurationID(String entryName)
      Gets the ID of the configuration object, the designated entry name stems from. This is useful for inherited/merged configurations when checking for invalid configuration values. This allows to provide a reasonable message indicating the problem, for instance "ActivityTemplateDefinition" in case of an overriding configuration of an ActivityTemplateDefinition containing an invalid value.
      Parameters:
      entryName - The name of the entry of which to retrieve the ID of its configuration.
      Returns:
      The ID of the configuration providing a value for the designated entry.
      See Also: