Package com.emc.d2fs.utils

# Class Parameters

java.lang.Object
com.emc.d2fs.utils.Parameters

public class Parameters extends Object
Parameter object -- used in OpenAjax pub/sub event arguments.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `EQ_ENCODED`
  Replacement string for PARAM_EQ if found in the parameter value
  `static final String`
  `PARAM_EQ`
  Event message - Equals/Assignment
  `static final String`
  `PARAM_SEPARATOR`
  Event message - Separator
  `static final String`
  `SEP_ENCODED`
  Replacement string for PARAM_SEPARATOR if found in the parameter value

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Parameters()`
  `Parameters(Parameters parametersToClone)`
  `Parameters(String message)`
  `Parameters(String... params)`
  `Parameters(String paramKey, String paramValue)`
  Creates a new parameters object with this key/value data
  `Parameters(String message, Map<String,Object> params)`
  `Parameters(Map<String,String> params)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addParameters(Item item)`
  Add parameters from item attributes
  `void`
  `addParameters(Node node)`
  Add parameters from node Attributes
  `void`
  `addParameters(Parameters params)`
  Add parameters
  `void`
  `addParameters(Parameters params, boolean override)`
  Add parameters
  `void`
  `addParameters(List<Attribute> attributes)`
  Add parameters
  `void`
  `addParameters(Map<String,Object> properties)`
  Add parameters
  `static String`
  `decodeParameterValue(String paramValue)`
  Decode parameter value from previously encoded characters If you value has been encoded using encodeParameterValue, you must use this method to convert back some character that may have been encoded
  `static String`
  `encodeParameterValue(String paramValue)`
  Encode parameter value to avoid parsing issue when specific character or character combination are present in the value
  `boolean`
  `equals(Object obj)`
  `String`
  `getParameter(String parameterName)`
  Get a parameter
  `String`
  `getParameter(String parameterName, String defaultValue)`
  Get a parameter
  `boolean`
  `getParameterBoolean(String parameterName)`
  Get a boolean value
  `boolean`
  `getParameterBoolean(String parameterName, boolean defaultValue)`
  Get a boolean parameter
  `boolean[]`
  `getParameterBooleanMultiple(String parameterName)`
  Get a boolean array parameter
  `int`
  `getParameterInt(String parameterName)`
  Get an integer parameter
  `int`
  `getParameterInt(String parameterName, int defaultValue)`
  Get an integer parameter
  `int[]`
  `getParameterIntMultiple(String parameterName)`
  Get an integer array parameter
  `Map<String,String>`
  `getParameters()`
  Get all parameters.
  `String[]`
  `getParameters(String parameterName)`
  Get an array parameter
  `boolean`
  `hasParameter(String parameterName)`
  Determine if parameters exists.
  `boolean`
  `isParameterMultiple(String parameterName)`
  Determine if parameter has multiple values
  `boolean`
  `isValueInParameter(String parameterName, String value, boolean returnTrueIParameterNull)`
  `Parameters`
  `removeParameter(String parameterName)`
  Remove parameter
  `Parameters`
  `setParameter(Attribute attribute)`
  Set parameter (override it if already exists)
  `Parameters`
  `setParameter(String parameterName, boolean parameterValue)`
  Set parameter (override it if already exists)
  `Parameters`
  `setParameter(String parameterName, boolean[] parameterValues)`
  Set parameter (override it if already exists)
  `Parameters`
  `setParameter(String parameterName, int parameterValue)`
  Set parameter (override it if already exists)
  `Parameters`
  `setParameter(String parameterName, int[] parameterValues)`
  Set parameter (override it if already exists)
  `Parameters`
  `setParameter(String parameterName, String parameterValue)`
  Set parameter (override it if already exists)
  `Parameters`
  `setParameter(String parameterName, String[] parameterValues)`
  Set parameter (override it if already exists)
  `Parameters`
  `setParameter(String parameterName, String parameterValue, boolean override)`
  Set parameter
  `Parameters`
  `setParameter(String parameterName, List<String> parameterValues)`
  Set parameter (override it if already exists)
  `boolean`
  `setRawParameter(String parameter)`
  Set a parameter from parameter string
  `String`
  `toString()`
  Get all parameters as string

  ### Methods inherited from class java.lang.Object

  `getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### SEP_ENCODED

    public static final String SEP_ENCODED
    Replacement string for PARAM_SEPARATOR if found in the parameter value
    See Also:
      - Constant Field Values

  - ### EQ_ENCODED

    public static final String EQ_ENCODED
    Replacement string for PARAM_EQ if found in the parameter value
    See Also:
      - Constant Field Values

  - ### PARAM_EQ

    public static final String PARAM_EQ
    Event message - Equals/Assignment
    See Also:
      - Constant Field Values

  - ### PARAM_SEPARATOR

    public static final String PARAM_SEPARATOR
    Event message - Separator
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### Parameters

    public Parameters()

  - ### Parameters

    public Parameters(Map<String,String> params)
    Parameters:
      `params` - a map of key/value that will be added

  - ### Parameters

    public Parameters(String paramKey, String paramValue)
    Creates a new parameters object with this key/value data
    Parameters:
      `paramKey` -
      `paramValue` -

  - ### Parameters

    public Parameters(String... params)
    Parameters:
      `params` - : key1, value1, key2, value2, key3, value3... that will be added

  - ### Parameters

    public Parameters(String message, Map<String,Object> params) throws ParseException
    Parameters:
      `message` - OpenAjaxHub string message that will be parsed
      `params` - a map of key/value that will be added
    Throws:
      `ParseException`

  - ### Parameters

    public Parameters(Parameters parametersToClone)
    Parameters:
      `parametersToClone` - Parameters that will be cloned

  - ### Parameters

    public Parameters(String message) throws ParseException
    Parameters:
      `message` - OpenAjaxHub string message that will be parsed
    Throws:
      `ParseException` - if no equal separator is detected on one parameter, parameter must always be under the form of key==value or key== or key==null

- ## Method Details

  - ### setParameter

    public Parameters setParameter(String parameterName, String parameterValue)
    Set parameter (override it if already exists)
    Parameters:
      `parameterName` - Name of parameter
      `parameterValue` - Value of parameter
    Returns:
      this

  - ### setParameter

    public Parameters setParameter(String parameterName, String[] parameterValues)
    Set parameter (override it if already exists)
    Parameters:
      `parameterName` - Name of parameter
      `parameterValues` - Values of parameter an array of values
    Returns:
      this

  - ### setParameter

    public Parameters setParameter(String parameterName, List<String> parameterValues)
    Set parameter (override it if already exists)
    Parameters:
      `parameterName` - Name of parameter
      `parameterValues` - an list of values
    Returns:
      this

  - ### setParameter

    public Parameters setParameter(String parameterName, int parameterValue)
    Set parameter (override it if already exists)
    Parameters:
      `parameterName` - Name of parameter
      `parameterValue` - integer value
    Returns:
      this

  - ### setParameter

    public Parameters setParameter(String parameterName, int[] parameterValues)
    Set parameter (override it if already exists)
    Parameters:
      `parameterName` - Name of parameter
      `parameterValues` - an array of values
    Returns:
      this

  - ### setParameter

    public Parameters setParameter(String parameterName, boolean parameterValue)
    Set parameter (override it if already exists)
    Parameters:
      `parameterName` - Name of parameter
      `parameterValue` - Value of parameter
    Returns:
      this

  - ### setParameter

    public Parameters setParameter(Attribute attribute)
    Set parameter (override it if already exists)
    Parameters:
      `attribute` -
    Returns:
      this

  - ### setParameter

    public Parameters setParameter(String parameterName, boolean[] parameterValues)
    Set parameter (override it if already exists)
    Parameters:
      `parameterName` - Name of parameter
      `parameterValues` - an array of values
    Returns:
      this

  - ### setParameter

    public Parameters setParameter(String parameterName, String parameterValue, boolean override)
    Set parameter
    Parameters:
      `parameterName` - Name of parameter
      `parameterValue` - Value of parameter
      `override` - if true, the value will be overwritten if already existing
    Returns:
      this

  - ### removeParameter

    public Parameters removeParameter(String parameterName)
    Remove parameter
    Parameters:
      `parameterName` - Name of parameter
    Returns:
      this

  - ### isParameterMultiple

    public boolean isParameterMultiple(String parameterName)
    Determine if parameter has multiple values
    Parameters:
      `parameterName` - Name of parameter
    Returns:
      true if the parameter has multiple values

  - ### setRawParameter

    public boolean setRawParameter(String parameter) throws ParseException
    Set a parameter from parameter string
    Parameters:
      `parameter` - "paramName1==paramValue1!!parameterName2==paramValue2"
    Returns:
      true if the parameter to parse and setup is correct, if consecutive parameter separator is found it will return false
    Throws:
      `ParseException` - if no equal separator is detected on one parameter, parameter must always be under the form of key==value or key== or key==null

  - ### getParameter

    public String getParameter(String parameterName)
    Get a parameter
    Parameters:
      `parameterName` - Name of parameter
    Returns:
      the value of this parameter or null if this parameter does not exist

  - ### getParameters

    public String[] getParameters(String parameterName)
    Get an array parameter
    Parameters:
      `parameterName` - Name of parameter
    Returns:
      the values of this parameter or null if this parameter does not exist

  - ### getParameter

    public String getParameter(String parameterName, String defaultValue)
    Get a parameter
    Parameters:
      `parameterName` - Name of parameter
      `defaultValue` - value returned if the parameter is not found
    Returns:
      the value of this parameter

  - ### decodeParameterValue

    public static String decodeParameterValue(String paramValue)
    Decode parameter value from previously encoded characters If you value has been encoded using encodeParameterValue, you must use this method to convert back some character that may have been encoded
    Parameters:
      `paramValue` -
    Returns:
      decoded paramValue cleared of the special character encoded, so just the value you wanted

  - ### encodeParameterValue

    public static String encodeParameterValue(String paramValue)
    Encode parameter value to avoid parsing issue when specific character or character combination are present in the value
    Parameters:
      `paramValue` -
    Returns:
      encoded paramValue free of the special character that could break the parsing

  - ### getParameterBoolean

    public boolean getParameterBoolean(String parameterName)
    Get a boolean value
    Parameters:
      `parameterName` - Name of parameter
    Returns:
      the boolean value

  - ### getParameterBooleanMultiple

    public boolean[] getParameterBooleanMultiple(String parameterName)
    Get a boolean array parameter
    Parameters:
      `parameterName` - Name of parameter
    Returns:
      the boolean values

  - ### getParameterBoolean

    public boolean getParameterBoolean(String parameterName, boolean defaultValue)
    Get a boolean parameter
    Parameters:
      `parameterName` - Name of parameter
      `defaultValue` - value returned if the parameter is not found or invalid
    Returns:
      the boolean value

  - ### getParameterInt

    public int getParameterInt(String parameterName)
    Get an integer parameter
    Parameters:
      `parameterName` - Parameter name
    Returns:
      the integer value

  - ### getParameterIntMultiple

    public int[] getParameterIntMultiple(String parameterName)
    Get an integer array parameter
    Parameters:
      `parameterName` - Name of parameter
    Returns:
      the integer values

  - ### getParameterInt

    public int getParameterInt(String parameterName, int defaultValue)
    Get an integer parameter
    Parameters:
      `parameterName` - Name of parameter
      `defaultValue` - value returned if the parameter is not found or invalid
    Returns:
      the integer value

  - ### isValueInParameter

    public boolean isValueInParameter(String parameterName, String value, boolean returnTrueIParameterNull)
    Parameters:
      `parameterName` - : the parameter to analyze
      `value` - : the value to find in the parameter
      `returnTrueIParameterNull` - : if param or value is null, return true
    Returns:
      true if the value in is the parameter ( single or multiple )

  - ### toString

    public String toString()
    Get all parameters as string
    Overrides:
      `toString` in class `Object`
    Returns:
      a string of all the parameters concatenated, ready to be parsed

  - ### addParameters

    public void addParameters(Parameters params)
    Add parameters
    Parameters:
      `params` - Parameters object

  - ### addParameters

    public void addParameters(Parameters params, boolean override)
    Add parameters
    Parameters:
      `params` - Parameters object
      `override` - true to overwrite existing values

  - ### addParameters

    public void addParameters(List<Attribute> attributes)
    Add parameters
    Parameters:
      `attributes` - List of attributes

  - ### addParameters

    public void addParameters(Map<String,Object> properties)
    Add parameters
    Parameters:
      `properties` - Property map.

  - ### addParameters

    public void addParameters(Item item)
    Add parameters from item attributes
    Parameters:
      `item` - D2FS Model item

  - ### addParameters

    public void addParameters(Node node)
    Add parameters from node Attributes
    Parameters:
      `node` - D2FS Model node

  - ### getParameters

    public Map<String,String> getParameters()
    Get all parameters.
    Returns:
      Map of parameters

  - ### hasParameter

    public boolean hasParameter(String parameterName)
    Determine if parameters exists.
    Parameters:
      `parameterName` - Name of Parameter
    Returns:
      true if parameter exists

  - ### equals

    public boolean equals(Object obj)
    Overrides:
      `equals` in class `Object`