Class TypedParameters
java.lang.Object
com.aquima.interactions.portal.model.def.TypedParameters
- All Implemented Interfaces:
IParameters
,ITypedParameters
,Serializable
This class contains the (typed) parameters for a service or container expander.
- Since:
- 7.0
- Author:
- J. van Leuven
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTypedParameters
(boolean allowEmptyParameters) Constructs an empty Parameters object.TypedParameters
(ITypedParameters 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.getTypedParameter
(String key) This method will return the value for the specified parameter key.String[]
This method returns the keys of the parameters matching the specified type.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).setParameter
(String key, String strValue) This method will set the parameter value for the specified parameter key.setTypedParameter
(String key, ITypedParameter typedParameter) This method will set the parameter value for the specified parameter key.toString()
static TypedParameters
This method clones the passed parameter object, but makes the result immutable.
-
Constructor Details
-
TypedParameters
public TypedParameters(boolean allowEmptyParameters) Constructs an empty Parameters object.- Parameters:
allowEmptyParameters
- Boolean indicating if empty parameter values should be allowed.
-
TypedParameters
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.
-
setTypedParameter
This method will set the parameter value for the specified parameter key.- Parameters:
key
- The parameter key for which the value should be set.typedParameter
- The value that should be set for the specified key.- Returns:
- The old value of the specified parameter key.
-
toString
-
getTypedParameter
Description copied from interface:ITypedParameters
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:
getTypedParameter
in interfaceITypedParameters
- Parameters:
key
- The parameter key for which the value is requested.- Returns:
- The typed value for the specified parameter key.
-
getTypedParameterKeys
This method returns the keys of the parameters matching the specified type.- Parameters:
type
- The parameter type of which the keys are requested.- Returns:
- the keys of the parameters matching the specified type.
-