public class Parameter extends Object implements Serializable
Note that while its reference cannot be changed once set (the attribute is final
), the
parameter descriptor itself is possibly mutable (it can be set as immutable, but it is not a
definitive property and it's not the case by default). Also note that it is possible for the
parameter descriptor to be null
or empty (that is, not associated with any field).
However, using parameters in such a state is strongly discouraged since it can potentially lead
to errors if higher-level methods do not handle these cases properly.
Constructor and Description |
---|
Parameter(ParameterDescriptor parameterDescriptor,
double parameterValue)
Creates a new instance using the provided parameter descriptor and value.
|
Parameter(String parameterName,
double parameterValue)
Creates a new instance using the provided name and value.
|
Modifier and Type | Method and Description |
---|---|
Parameter |
copy()
Performs a shallow copy of this parameter (the references to the field descriptors and the
mapped values are preserved).
|
ParameterDescriptor |
getDescriptor()
Gets the parameter descriptor.
|
String |
getName()
Gets the parameter name, which is a concatenation of field values currently associated with
the parameter descriptor (printed in reverse order by default).
|
String |
getName(boolean reverseOrder)
Gets the parameter name, which is a concatenation of field values currently associated with
the parameter descriptor.
|
String |
getName(String separator)
Gets the parameter name, which is a concatenation of field values currently associated with
the parameter descriptor (printed in reverse order by default).
|
String |
getName(String separator,
boolean reverseOrder)
Gets the parameter name, which is a concatenation of field values currently associated with
the parameter descriptor.
|
double |
getValue()
Gets the parameter value.
|
void |
setValue(double parameterValue)
Sets the parameter value.
|
String |
toString()
Gets a string representation of this parameter, which includes the name of this class, the
name of the parameter and the parameter value.
|
String |
toString(boolean reverseOrder)
Gets a string representation of this parameter, which includes the name of this class, the
name of the parameter and the parameter value.
|
String |
toString(String nameSeparator,
String valueSeparator,
boolean printClassName,
boolean reverseOrder)
Gets a string representation of this parameter, which includes the name of this class (if
requested), the name of the parameter and the parameter value.
|
public Parameter(String parameterName, double parameterValue)
parameterName
- the parameter nameparameterValue
- the parameter valuepublic Parameter(ParameterDescriptor parameterDescriptor, double parameterValue)
parameterDescriptor
- the parameter descriptorparameterValue
- the parameter valuepublic ParameterDescriptor getDescriptor()
public String getName()
public String getName(boolean reverseOrder)
reverseOrder
- whether or not the field values should be printed in reverse ordernull
if the parameter descriptor associated with this
parameter is null
public String getName(String separator)
separator
- the string used as separator between two field valuesnull
if the parameter descriptor associated with this
parameter is null
public String getName(String separator, boolean reverseOrder)
separator
- the string used as separator between two field valuesreverseOrder
- whether or not the field values should be printed in reverse ordernull
if the parameter descriptor associated with this
parameter is null
public double getValue()
public void setValue(double parameterValue)
parameterValue
- the new parameter valuepublic String toString()
public String toString(boolean reverseOrder)
reverseOrder
- whether or not the associated field values should be printed in reverse orderpublic String toString(String nameSeparator, String valueSeparator, boolean printClassName, boolean reverseOrder)
nameSeparator
- the string to be used as separator when retrieving the name of the parametervalueSeparator
- the string to be used as separator between the name of the parameter and its valueprintClassName
- whether or not the name of this class should be printedreverseOrder
- whether or not the associated field values should be printed in reverse ordergetName(String, boolean)
public Parameter copy()
Copyright © 2021 CNES. All rights reserved.