Class Parameters

java.lang.Object
com.aquima.interactions.foundation.Parameters
All Implemented Interfaces:
IParameters, Serializable

public final class Parameters extends Object implements IParameters
Default implementation of the IParameter interface.
Since:
5.0
Author:
O. Kerpershoek
See Also:
  • Constructor Details

    • Parameters

      public Parameters(boolean allowEmptyParameters)
      Constructs an empty Parameters object.
      Parameters:
      allowEmptyParameters - Boolean indicating if empty parameter values should be allowed.
    • Parameters

      public Parameters(IParameters other, boolean allowEmptyParameters)
      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

      public static Parameters unmodifiableClone(IParameters other)
      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 interface IParameters
      Returns:
      true when this object hold no parameters, false when one or more parameters are present.
    • hasParameter

      public boolean hasParameter(String key)
      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 interface IParameters
      Parameters:
      key - String containing the parameter key.
      Returns:
      boolean indicating if the parameter is defined.
    • getParameterKeys

      public String[] 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 interface IParameters
      Returns:
      Array containing all parameter keys.
    • getParameter

      public String getParameter(String key)
      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 interface IParameters
      Parameters:
      key - The parameter key for which the value is requested.
      Returns:
      The value for the specified parameter key.
    • setParameter

      public String setParameter(String key, String strValue)
      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

      public String removeParameter(String key)
      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

      public String toString()
      Overrides:
      toString in class Object