Package com.denodo.configuration
Class Parameter<T>
java.lang.Object
com.denodo.configuration.Parameter<T>
- Type Parameters:
T-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
CompoundParameter,SimpleParameter
Parameters have a name and a value if they are single-valued or a
Collection of values if they are multivalued.
The type of
SimpleParameter values is an Object.
The type of all values must be the same.
The type of CompoundParameter values is a
ParameterStructure which contains Parameter
objects.
Two implementations of Parameter are provided:
As an example consider the "accounts" parameter required by a mail
crawler. This parameter specifies which mail accounts should be crawled and
it is a multivalued compound parameter. Each value of the "accounts"
parameter is a structure of two simple parameters:
- "login" parameter:single-valued, containing a
String - "password" parameter: single-valued containing a
String
ParameterStructure, each ParameterStructure
representing one account to be crawled with one "login" and one "password".- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidAdds a new value to the parameter.booleanintgetName()Obtains the name of the parameter.abstract TgetValue()Obtains the first value of the parameter if it is a multivalued parameter or the unique value if it is a single-valued parameter.abstract Collection<T>Obtains the values of the parameter.inthashCode()booleanvoidsetEncrypted(boolean encrypted) voidsetInstances(int instances) voidSets the name of the parameter.abstract voidsetValues(Collection<T> values) Sets the values of the parameter.
-
Field Details
-
instances
-
-
Constructor Details
-
Parameter
public Parameter()Creates a new Parameter object. -
Parameter
Creates a new Parameter object with the given name.- Parameters:
name- the name of parameter.
-
Parameter
-
-
Method Details
-
getInstances
public int getInstances() -
setInstances
public void setInstances(int instances) -
getName
Obtains the name of the parameter.- Returns:
- the parameter name.
-
setName
Sets the name of the parameter.- Parameters:
name- the name to set.
-
getValue
Obtains the first value of the parameter if it is a multivalued parameter or the unique value if it is a single-valued parameter.- Returns:
- the first value of the parameter if it is multivalued; the unique value if it is single-valued.
-
getValues
Obtains the values of the parameter.- Returns:
- the collection of parameter values.
-
setValues
Sets the values of the parameter.- Parameters:
values- the Collection of values to set.
-
addValue
Adds a new value to the parameter.- Parameters:
value- the value to add.
-
isEncrypted
public boolean isEncrypted() -
setEncrypted
public void setEncrypted(boolean encrypted) -
equals
-
hashCode
public int hashCode()
-