Overview | Package | Class | Use | Tree | Deprecated | Index | Help
|  | BEA Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.connecterra.ale.dynamicconfig.api
Class PluginConfigParameter

    java.lang.Object
      com.connecterra.ale.dynamicconfig.api.PluginConfigParameter

    public abstract class PluginConfigParameter

extends Object

Models an individual parameter contained within a `PluginConfig`. Contains:

- Key name of the `PluginParameterMeta` that describes the configuration parameter.
- The configuration value.
- Child `PluginConfigParameter`s, if this is for a parameter group.
- Table row entries, if this contains a table.

Constructor Summary
`PluginConfigParameter()`

Method Summary
`void` | `addChildParameter(PluginConfigParameter pluginConfigParameter)` Specifies the value on one child parameter.
`Boolean` | `getBooleanValue()` Utility method to get the boolean value on this parameter.
`PluginConfigParameter` | `getChildParameter(String keyName)` Finds and returns child parameter with the given key name.
`List` | `getChildParameterList()` Returns list of PluginConfigParameter containing the child parameter values.
`abstract String` | `getMetaKeyName()` Returns the key name of the `PluginParameterMeta` that describes the parameter.
`Long` | `getNumericValue()` Utility method to get the numeric value on this parameter.
`abstract Object` | `getParameterValue()` Returns the value for the configuration parameter.
`List` | `getStringListValue()` Utility method to get the string list value on this parameter.
`String` | `getStringValue()` Utility method to get the string value on this parameter.
`abstract List` | `getTableRows()` Returns the row entries of the table that this parameter contains.
`void` | `setChildParameterList(List childParameterList)` Specifies the values on the child parameters.
`abstract void` | `setParameterValue(Object paramValue)` Sets the value for the configuration parameter.
`abstract void` | `setTableRows(List tableRows)` Sets the table value of this parameter.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### PluginConfigParameter

    public PluginConfigParameter()

Method Detail

### getMetaKeyName

    public abstract String getMetaKeyName()

  Returns the key name of the `PluginParameterMeta` that describes the parameter.

  Returns:
    key name of the `PluginParameterMeta` that describes the parameter

### getParameterValue

    public abstract Object getParameterValue()

  Returns the value for the configuration parameter. This will return a String if this is a single valued parameter and List of String otherwise. This may return null if the parameter has no value specified.

  Returns:
    the value of the configuration parameter. This will be a String if this is a parameter that must have only a single value, a List of String otherwise. Null may be returned if no value has been specified for the parameter.

### setParameterValue

    public abstract void setParameterValue(Object paramValue)

  Sets the value for the configuration parameter.

  Parameters:
    `paramValue` - the value for the parameter

### getStringValue

    public String getStringValue()

  Utility method to get the string value on this parameter. If this parameter contains a non-string value (List), this method will throw an unchecked exception. It is assumed that the caller knows that this parameter contains a string beforehand. Empty string value is considered equivalent to null and will be converted to null.

  The current implementation will not return the default value if no value is specified for the parameter. It is the responsibility of the caller to get the default value, if needed.

  Returns:
    the string value of the parameter. If no value was assigned for this parameter, this will return null.
  Throws:
    `IllegalStateException` - if the parameter contains a list value instead of a string

### getNumericValue

    public Long getNumericValue()

  Utility method to get the numeric value on this parameter. If this parameter contains a non-string value (List) or a string value that cannot parsed as a long, this method will throw an unchecked exception. It is assumed that the caller knows that this parameter contains a parsable long value beforehand.

  The current implementation will not return the default value if no value is specified for the parameter. It is the responsibility of the caller to get the default value, if needed.

  Returns:
    long obtained by parsing the string value of this parameter. Null will be returned if no value is set on this parameter.
  Throws:
    `IllegalStateException` - if the parameter contains a list value instead of a string
    `NumberFormatException` - if the value is not parsable as a long

### getBooleanValue

    public Boolean getBooleanValue()

  Utility method to get the boolean value on this parameter. If this parameter contains a non-string value (List) this method will throw an unchecked exception. It is assumed that the caller knows that this parameter contains a string beforehand.

  The current implementation will not return the default value if no value is specified for the parameter. It is the responsibility of the caller to get the default value, if needed.

  Returns:
    the boolean value for the parameter. Null will be returned if no value is set on this parameter.
  Throws:
    `IllegalStateException` - if the parameter contains a list value instead of a string or if it contains a string value that is not "true" or "false" (case insensitive)

### getStringListValue

    public List getStringListValue()

  Utility method to get the string list value on this parameter. If this parameter does not contain a List of strings, this method will throw an unchecked exception. It is assumed that the caller knows that this parameter contains a list of strings beforehand.

  The current implementation will not return the default value if no value is specified for the parameter. It is the responsibility of the caller to get the default value, if needed.

  Returns:
    the string list value of the parameter. If no value was assigned for this parameter, this will return null.
  Throws:
    `IllegalStateException` - if the parameter contains a non-list value

### getTableRows

    public abstract List getTableRows()

  Returns the row entries of the table that this parameter contains. This method returns a list of rows, where each row is a list of PluginConfigParameter. Each PluginConfigParamter represents a cell of the table. In the future, the cells themselves may be more complex parameters, like tables or lists.

  Returns:
    list of rows of the table, where each row is a list of PluginConfigParameter. This will return null if the parameter does not contain a table value.

### setTableRows

    public abstract void setTableRows(List tableRows)

  Sets the table value of this parameter. This accepts a list of rows, where each row is a list of PluginConfigParameter. Each PluginConfigParamter represents a cell of the table.

  Parameters:
    `tableRows` - List of table rows, where each table row is a list of PluginConfigParameter.

### getChildParameterList

    public List getChildParameterList()

  Returns list of PluginConfigParameter containing the child parameter values. Returns an empty list if there are no child parameter values.

  Returns:
    list of PluginConfigParameter containing the child parameter values

### setChildParameterList

    public void setChildParameterList(List childParameterList)

  Specifies the values on the child parameters.

  Parameters:
    `childParameterList` - list of child `PluginConfigParameter`s with the values on the child parameters``

### addChildParameter

    public void addChildParameter(PluginConfigParameter pluginConfigParameter)
                           throws DuplicateNameException

  Specifies the value on one child parameter.

  Parameters:
    `pluginConfigParameter` - the PluginConfigParameter with the child parameter value
  Throws:
    `DuplicateNameException` - if a PluginConfigParameter for the same key name already exists

### getChildParameter

    public PluginConfigParameter getChildParameter(String keyName)
                                            throws NoSuchNameException

  Finds and returns child parameter with the given key name.

  Parameters:
    `keyName` - the key name of the parameter that is to be found
  Returns:
    the PluginConfigParameter with matching key name
  Throws:
    `NoSuchNameException` - if there is no child parameter with the specified key

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Documentation is available at ${DOCSWEBROOT} Copyright 2007 BEA Systems Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD