Class Parameters
java.lang.Object
com.aquima.interactions.foundation.Parameters
- All Implemented Interfaces:
IParameters
,Serializable
Default implementation of the IParameter interface.
- Since:
- 5.0
- Author:
- O. Kerpershoek
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionParameters
(boolean allowEmptyParameters) Constructs an empty Parameters object.Parameters
(IParameters other, boolean allowEmptyParameters) Constructs a new Parameter object based on another parameter object. -
Method Summary
Modifier and TypeMethodDescriptiongetParameter
(String key) This method will return the value for the specified parameter key.String[]
This method returns an array containing all the parameter keys that are defined.boolean
hasParameter
(String key) This method will return a boolean indicating if a parameter with the specified key is present.boolean
isEmpty()
This method returns a boolean indicating whether the parameter map is empty (contains no parameters).removeParameter
(String key) This method will remove the parameter value of the specified parameter key.setParameter
(String key, String strValue) This method will set the parameter value for the specified parameter key.toString()
static Parameters
unmodifiableClone
(IParameters other) This method clones the passed parameter object, but makes the result immutable.
-
Constructor Details
-
Parameters
public Parameters(boolean allowEmptyParameters) Constructs an empty Parameters object.- Parameters:
allowEmptyParameters
- Boolean indicating if empty parameter values should be allowed.
-
Parameters
Constructs a new Parameter object based on another parameter object. All parameters from the other object will be copied into this parameter object.- Parameters:
other
- The other parameter object from which the parameters should be copied.allowEmptyParameters
- Boolean indicating if empty parameter values should be allowed.
-
-
Method Details
-
unmodifiableClone
This method clones the passed parameter object, but makes the result immutable.- Parameters:
other
- The parameter object that should be duplicated.- Returns:
- A read-only duplicate of the supplied parameter map.
-
isEmpty
public boolean isEmpty()Description copied from interface:IParameters
This method returns a boolean indicating whether the parameter map is empty (contains no parameters).- Specified by:
isEmpty
in interfaceIParameters
- Returns:
- true when this object hold no parameters, false when one or more parameters are present.
-
hasParameter
Description copied from interface:IParameters
This method will return a boolean indicating if a parameter with the specified key is present. The parameter key is not case sensitive.
Note: When this method returns true for a specified parameter key, the value of that parameter may still be empty.- Specified by:
hasParameter
in interfaceIParameters
- Parameters:
key
- String containing the parameter key.- Returns:
- boolean indicating if the parameter is defined.
-
getParameterKeys
Description copied from interface:IParameters
This method returns an array containing all the parameter keys that are defined. When no parameters are present (isEmpty method return true), an empty array will be returned.- Specified by:
getParameterKeys
in interfaceIParameters
- Returns:
- Array containing all parameter keys.
-
getParameter
Description copied from interface:IParameters
This method will return the value for the specified parameter key. The returned value may be null when either the parameter key was unknown, or when the value for that parameter key was specifically defined as empty. When a null is returned, the hasParameter method may be used to check if the parameter was present (intended null) or unknown.- Specified by:
getParameter
in interfaceIParameters
- Parameters:
key
- The parameter key for which the value is requested.- Returns:
- The value for the specified parameter key.
-
setParameter
This method will set the parameter value for the specified parameter key.- Parameters:
key
- The parameter key for which the value should be set.strValue
- The value that should be set for the specified key.- Returns:
- The old value of the specified parameter key.
-
removeParameter
This method will remove the parameter value of the specified parameter key.- Parameters:
key
- The parameter key of which the value should be removed.- Returns:
- The value of the parameter key that was removed.
-
toString
-