Klasse Parameter

java.lang.Object
de.dlr.proseo.model.Parameter

@Embeddable public class Parameter extends Object
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
  • 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 parameter
      parameterValue - 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

      public ParameterType getParameterType()
      Gets the type of the parameter
      Gibt zurück:
      the parameter type
    • setParameterType

      public void setParameterType(ParameterType parameterType)
      Sets the type of the parameter
      Parameter:
      parameterType - the type to set
    • getParameterValue

      public String getParameterValue()
      Gets the value of the parameter
      Gibt zurück:
      the parameter value
    • setParameterValue

      public void setParameterValue(Serializable parameterValue) throws IllegalArgumentException
      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

      public String getStringValue() throws ClassCastException
      Gets the parameter value as String
      Gibt zurück:
      the parameter value
      Löst aus:
      ClassCastException
    • setStringValue

      public void setStringValue(String newValue)
      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

      public Integer getIntegerValue() throws ClassCastException
      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

      public void setIntegerValue(Integer newValue)
      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

      public Boolean getBooleanValue() throws ClassCastException
      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

      public void setBooleanValue(Boolean newValue)
      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

      public Double getDoubleValue() throws ClassCastException
      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

      public void setDoubleValue(Double newValue)
      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

      public Instant getInstantValue() throws ClassCastException
      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

      public void setInstantValue(TemporalAccessor newValue)
      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()
      Setzt außer Kraft:
      hashCode in Klasse Object
    • equals

      public boolean equals(Object obj)
      Setzt außer Kraft:
      equals in Klasse Object
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Object