org.rhq.enterprise.communications.command.param
Interface Parameters

All Superinterfaces:
Collection<Parameter>, Iterable<Parameter>, Serializable
All Known Implementing Classes:
ParametersImpl

public interface Parameters
extends Collection<Parameter>, Serializable

Defines a collection of parameters.

Author:
John Mazzitelli

Method Summary
 void applyResourceBundleToParameterRenderingInformation(ResourceBundle resourceBundle)
          This will apply the given resourceBundle to the parameters in this collection.
 boolean contains(Parameter parameter)
          Checks to see if this parameter exists by specifying the parameter - only the name is used when checking.
 boolean contains(String parameterName)
          Checks if this parameter exists by specifying the parameter name.
 Parameters getInternalParameters()
          Returns a ParametersImpl collection that consists of this object's hidden parameters.
 Parameter getParameter(String parameterName)
          Given the name of a parameter, this will return its associated Parameter.
 ParameterDefinition getParameterDefinition(String parameterName)
          Given the name of a parameter, this will return the parameter's definition.
 Object getParameterValue(String parameterName)
          Given the name of a parameter, this will return the parameter's value.
 Parameters getPublicParameters()
          Returns a ParametersImpl collection that consists of this object's non-hidden parameters.
 boolean remove(Parameter parameter)
          Removes the parameter whose name is the same as the name in the given parameter.
 boolean remove(String parameterName)
          Removes the parameter stored in this collection whose name matches parameterName.
 void setParameterValue(String parameterName, Object parameterValue)
          Given the name of a parameter, this will set the parameter's value.
 
Methods inherited from interface java.util.Collection
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 

Method Detail

getParameter

Parameter getParameter(String parameterName)
Given the name of a parameter, this will return its associated Parameter. If it doesn't exist in this collection, null is returned.

Parameters:
parameterName - the name of the parameter to get
Returns:
the parameter definition and value of the named parameter

getParameterDefinition

ParameterDefinition getParameterDefinition(String parameterName)
                                           throws InvalidParameterDefinitionException
Given the name of a parameter, this will return the parameter's definition. It is possible that a parameter exists, but its definition is null; in this case, null is returned. If the parameter does not exist in this collection, an exception is thrown.

Parameters:
parameterName - the name of the parameter whose definition is to be returned
Returns:
the parameter definition of the named parameter
Throws:
InvalidParameterDefinitionException - if the parameter does not exist in this collection

getParameterValue

Object getParameterValue(String parameterName)
                         throws InvalidParameterDefinitionException
Given the name of a parameter, this will return the parameter's value. Since a parameter's value is allowed to be null, a return value of null means the parameter exists but its value was null. If the parameter does not exist in this collection, an exception is thrown.

Parameters:
parameterName - the name of the parameter whose value is to be returned
Returns:
the parameter value of the named parameter
Throws:
InvalidParameterDefinitionException - if the parameter does not exist in this collection

setParameterValue

void setParameterValue(String parameterName,
                       Object parameterValue)
                       throws InvalidParameterDefinitionException
Given the name of a parameter, this will set the parameter's value. If the parameter doesn't exist in this collection, an exception is thrown.

Parameters:
parameterName - the name of the parameter whose value is to be set
parameterValue - the value of the parameter (may be null)
Throws:
InvalidParameterDefinitionException - if the parameter does not exist in this collection

getPublicParameters

Parameters getPublicParameters()
Returns a ParametersImpl collection that consists of this object's non-hidden parameters. In effect, this returns parameters that are typically for clients (such as a GUI) to provide values for.

Returns:
collection of public, non-hidden parameters

getInternalParameters

Parameters getInternalParameters()
Returns a ParametersImpl collection that consists of this object's hidden parameters. In effect, this returns only those parameters that are used internally - clients should not care about them or set their values. These are typically internal parameters for use by the executor but whose values are normally set without asking the client for the values.

Returns:
collection of internal (i.e. hidden) parameters

applyResourceBundleToParameterRenderingInformation

void applyResourceBundleToParameterRenderingInformation(ResourceBundle resourceBundle)
This will apply the given resourceBundle to the parameters in this collection. This allows you to localize the parameters.

Parameters:
resourceBundle - the resource bundle that is to be used when rendering the parameters

contains

boolean contains(String parameterName)
                 throws NullPointerException
Checks if this parameter exists by specifying the parameter name.

Parameters:
parameterName - the parameter name
Returns:
true if there is a parameter in this object identified by the parameterName
Throws:
NullPointerException - if parameterName is null, as per Collection interface contract

contains

boolean contains(Parameter parameter)
                 throws NullPointerException
Checks to see if this parameter exists by specifying the parameter - only the name is used when checking. This means as long as the given parameter's name matches one in the collection, this returns true, it doesn't matter if the parameter's value or definition completely match.

Parameters:
parameter - the parameter to check
Returns:
true if there is a parameter in this object identified by the parameterName
Throws:
NullPointerException - if parameter is null, as per Collection interface contract

remove

boolean remove(String parameterName)
               throws NullPointerException
Removes the parameter stored in this collection whose name matches parameterName.

Parameters:
parameterName - the name of the parameter to remove from this collection
Returns:
true if the object was removed; false if there was no object in this collection with the given parameter name
Throws:
NullPointerException - if parameterName is null, as per Collection interface contract

remove

boolean remove(Parameter parameter)
               throws NullPointerException
Removes the parameter whose name is the same as the name in the given parameter. The full definition and value of the given parameter is ignored when determining a match - only the parameter name is used in the comparision.

Parameters:
parameter - the parameter whose name is used to determine what to remove
Returns:
true if the object was removed
Throws:
NullPointerException - if parameter is null, as per Collection interface contract


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.