org.gcube.datatransformation.datatransformationlibrary.model
Class Parameter

java.lang.Object
  extended by org.gcube.datatransformation.datatransformationlibrary.model.Parameter

public class Parameter
extends Object

Author:
Dimitris Katris, NKUA

Parameter class represents a content type parameter.


Constructor Summary
Parameter()
          Instantiates a new parameter.
Parameter(String name, String value)
          Instantiates a new parameter by setting its name and value.
 
Method Summary
static boolean equals(List<Parameter> params1, List<Parameter> params2)
          Checks if two arrays of parameters are equal.
 boolean equals(Object obj)
           
 String getName()
          Returns the name of the parameter.
 String getValue()
          Returns the value of the parameter.
 int hashCode()
           
static int hashCode(List<Parameter> parameters)
          Returns the hash code of an array of parameters.
 boolean isOptional()
          Returns the isOptional value.
static boolean parameterExist(Parameter paramtofind, List<Parameter> inparameters)
          Checks if the paramtofind exists in inparameters array.
static boolean parameterNameExist(String parameterName, Parameter[] parametersToSearch)
          Checks if the parameter name exists in parametersToSearch array.
 void setName(String name)
          Sets the name of the parameter.
 void setOptional(boolean isOptional)
          Sets the isOptional value.
 void setValue(String value)
          Sets the value of the parameter.
protected  void toDOM(Element parent)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Parameter

public Parameter()
Instantiates a new parameter.


Parameter

public Parameter(String name,
                 String value)
Instantiates a new parameter by setting its name and value.

Parameters:
name - The name of the parameter.
value - The value of the parameter.
Method Detail

getName

public String getName()
Returns the name of the parameter.

Returns:
The name of the parameter.

setName

public void setName(String name)
Sets the name of the parameter.

Parameters:
name - The name of the parameter.

getValue

public String getValue()
Returns the value of the parameter.

Returns:
The value of the parameter.

setValue

public void setValue(String value)
Sets the value of the parameter.

Parameters:
value - The value of the parameter.

equals

public boolean equals(Object obj)
Overrides:
equals in class Object
Parameters:
obj - The object to be checked.
Returns:
True if this and the checked parameter are equal.
See Also:
Object.equals(java.lang.Object)

equals

public static boolean equals(List<Parameter> params1,
                             List<Parameter> params2)
Checks if two arrays of parameters are equal.

Parameters:
params1 - The first array.
params2 - The second array.
Returns:
True if the two arrays are equal.

parameterExist

public static boolean parameterExist(Parameter paramtofind,
                                     List<Parameter> inparameters)
Checks if the paramtofind exists in inparameters array.

Parameters:
paramtofind - The parameter to be found.
inparameters - The array in which the paramtofind is searched in.
Returns:
True if the paramtofind exists in inparameters array.

parameterNameExist

public static boolean parameterNameExist(String parameterName,
                                         Parameter[] parametersToSearch)
Checks if the parameter name exists in parametersToSearch array.

Parameters:
parameterName - The parameter name to be found
parametersToSearch - The array in which the parameterName is searched in.
Returns:
True if the parameter name exists.

isOptional

public boolean isOptional()
Returns the isOptional value.

Returns:
the isOptional value.

setOptional

public void setOptional(boolean isOptional)
Sets the isOptional value.

Parameters:
isOptional - the isOptional value.

hashCode

public int hashCode()
Overrides:
hashCode in class Object
Returns:
The hash code of this parameter.
See Also:
Object.hashCode()

hashCode

public static int hashCode(List<Parameter> parameters)
Returns the hash code of an array of parameters.

Parameters:
parameters - The parameters from which the hash code is created.
Returns:
the hash code of an array of parameters.

toDOM

protected void toDOM(Element parent)

toString

public String toString()
Overrides:
toString in class Object
Returns:
A string representation of Parameter.
See Also:
Object.toString()


Copyright © 2013. All Rights Reserved.