Package de.dlr.proseo.model
Klasse Parameter
java.lang.Object
de.dlr.proseo.model.Parameter
This class allows to add mission-specific parameters to any persistent object. A parameter consists of a type
(of the enum ParameterType) and a value with a class that corresponds to the type.
- Autor:
- Dr. Thomas Bassler
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungbooleanGets the parameter value as Boolean, if it has the appropriate typeGets the parameter value as Double, if it has the appropriate typeGets the parameter value as Instant, if it has the appropriate typeGets the parameter value as Integer, if it has the appropriate typeGets the type of the parameterGets the value of the parameterGets the parameter value as StringinthashCode()init(ParameterType parameterType, Serializable parameterValue) Initializer with type and value (values of type Short and Float are converted to Integer and Double, respectively)voidsetBooleanValue(Boolean newValue) Sets the value of the parameter to the given boolean and the type to ParameterType.BOOLEANvoidsetDoubleValue(Double newValue) Sets the value of the parameter to the given double and the type to ParameterType.DOUBLEvoidsetInstantValue(TemporalAccessor newValue) Sets the value of the parameter to the given instant and the type to ParameterType.INSTANTvoidsetIntegerValue(Integer newValue) Sets the value of the parameter to the given integer and the type to ParameterType.INTEGERvoidsetParameterType(ParameterType parameterType) Sets the type of the parametervoidsetParameterValue(Serializable parameterValue) Sets the value of the parametervoidsetStringValue(String newValue) Sets the value of the parameter to the given string and the type to ParameterType.STRINGtoString()
-
Konstruktordetails
-
Parameter
public Parameter()
-
-
Methodendetails
-
init
public Parameter init(ParameterType parameterType, Serializable parameterValue) throws IllegalArgumentException Initializer with type and value (values of type Short and Float are converted to Integer and Double, respectively)- Parameter:
parameterType- the type of the new parameterparameterValue- the value of the new parameter- Gibt zurück:
- the initialized parameter for chaining
- Löst aus:
IllegalArgumentException- if parameter type and class of parameter value do not match
-
getParameterType
Gets the type of the parameter- Gibt zurück:
- the parameter type
-
setParameterType
Sets the type of the parameter- Parameter:
parameterType- the type to set
-
getParameterValue
Gets the value of the parameter- Gibt zurück:
- the parameter value
-
setParameterValue
Sets the value of the parameter- Parameter:
parameterValue- the value to set- Löst aus:
IllegalArgumentException- if parameter type and class of parameter value do not match
-
getStringValue
Gets the parameter value as String- Gibt zurück:
- the parameter value
- Löst aus:
ClassCastException
-
setStringValue
Sets the value of the parameter to the given string and the type to ParameterType.STRING- Parameter:
newValue- the value to set (the type is implicit)
-
getIntegerValue
Gets the parameter value as Integer, if it has the appropriate type- Gibt zurück:
- the parameter value
- Löst aus:
ClassCastException- if the parameter is not of type ParameterType.INTEGER
-
setIntegerValue
Sets the value of the parameter to the given integer and the type to ParameterType.INTEGER- Parameter:
newValue- the value to set (the type is implicit)
-
getBooleanValue
Gets the parameter value as Boolean, if it has the appropriate type- Gibt zurück:
- the parameter value
- Löst aus:
ClassCastException- if the parameter is not of type ParameterType.BOOLEAN
-
setBooleanValue
Sets the value of the parameter to the given boolean and the type to ParameterType.BOOLEAN- Parameter:
newValue- the value to set (the type is implicit)
-
getDoubleValue
Gets the parameter value as Double, if it has the appropriate type- Gibt zurück:
- the parameter value
- Löst aus:
ClassCastException- if the parameter is not of type ParameterType.DOUBLE
-
setDoubleValue
Sets the value of the parameter to the given double and the type to ParameterType.DOUBLE- Parameter:
newValue- the value to set (the type is implicit)
-
getInstantValue
Gets the parameter value as Instant, if it has the appropriate type- Gibt zurück:
- the parameter value
- Löst aus:
ClassCastException- if the parameter is not of type ParameterType.INSTANT
-
setInstantValue
Sets the value of the parameter to the given instant and the type to ParameterType.INSTANT- Parameter:
newValue- the value to set (the type is implicit)
-
hashCode
public int hashCode() -
equals
-
toString
-