T
- public abstract class Parameter<T> extends Object implements Serializable
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:
String
String
ParameterStructure
, each ParameterStructure
representing one account to be crawled with one "login" and one "password".Modifier and Type | Field and Description |
---|---|
protected Integer |
instances |
protected static long |
serialVersionUID
For interoperability with possible future changes.
|
Constructor and Description |
---|
Parameter()
Creates a new Parameter object.
|
Parameter(String name)
Creates a new Parameter object with the given name.
|
Parameter(String name,
boolean encrypted) |
Modifier and Type | Method and Description |
---|---|
abstract void |
addValue(T value)
Adds a new value to the parameter.
|
boolean |
equals(Object obj) |
int |
getInstances() |
String |
getName()
Obtains the name of the parameter.
|
abstract T |
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.
|
abstract Collection<T> |
getValues()
Obtains the values of the parameter.
|
int |
hashCode() |
boolean |
isEncrypted() |
void |
setEncrypted(boolean encrypted) |
void |
setInstances(int instances) |
void |
setName(String name)
Sets the name of the parameter.
|
abstract void |
setValues(Collection<T> values)
Sets the values of the parameter.
|
protected static final long serialVersionUID
protected Integer instances
public Parameter()
public Parameter(String name)
name
- the name of parameter.public Parameter(String name, boolean encrypted)
public int getInstances()
public void setInstances(int instances)
public String getName()
public void setName(String name)
name
- the name to set.public abstract T getValue()
public abstract Collection<T> getValues()
public abstract void setValues(Collection<T> values)
values
- the Collection of values to set.public abstract void addValue(T value)
value
- the value to add.public boolean isEncrypted()
public void setEncrypted(boolean encrypted)
Copyright © 2024 Denodo Technologies. All rights reserved.