Interface Configuration
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
ActivityConfiguration,ChangeableActivityConfiguration,ChangeableConfiguration,MergingActivityConfiguration,MergingConfiguration
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 ClassesModifier and TypeInterfaceDescriptionstatic classThe IDs for configurations, seegetConfigurationID(String). -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longGenerated ID for serialisation. -
Method Summary
Modifier and TypeMethodDescriptionGets 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.getConfigurationID(String entryName) Gets the ID of the configuration object, the designated entry name stems from.Gets theDateconfiguration value provided under the designated entry name or null if the value is not present or cannot be parsed to aDatevalue.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.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[]Gets theUDTValueconfiguration value provided under the designated entry name or null if the value is not present or cannot be parsed to abyte[]value.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.booleanGets 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 serialVersionUIDGenerated ID for serialisation.- See Also:
-
-
Method Details
-
getBoolean
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
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
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
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
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
Gets theDateconfiguration value provided under the designated entry name or null if the value is not present or cannot be parsed to aDatevalue.- Parameters:
entryName- The name of the entry for which to retrieve theDatevalue of.- Returns:
- A
Dateconfiguration value for the designated entry or null in case the value is not present or cannot be parsed to aDatevalue.
-
getUDT
Gets theUDTValueconfiguration value provided under the designated entry name or null if the value is not present or cannot be parsed to abyte[]value.- Parameters:
entryName- The name for the entry for which to retrieve thebyte[]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 abyte[]value.
-
isFixed
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
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
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 anActivityTemplateDefinitioncontaining 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:
-