Class EnumValue

java.lang.Object
net.ssehub.easy.varModel.model.values.Value
net.ssehub.easy.varModel.model.values.EnumValue

public class EnumValue extends Value
Holding enum literals.
Author:
Marcel Lueder, Holger Eichelberger
  • Field Details

  • Constructor Details

    • EnumValue

      EnumValue()
      Constructor for serialization.
    • EnumValue

      protected EnumValue(Enum enumType)
      Constructor for a new EnumValue.
      Parameters:
      enumType - the Enum which defines the specific type of this EnumValue
    • EnumValue

      protected EnumValue(Enum enumType, EnumLiteral literal)
      Constructor for a new EnumValue.
      Parameters:
      enumType - the Enum which defines the specific type of this EnumValue
      literal - the initial value for the literal
    • EnumValue

      protected EnumValue(Enum enumType, Object value) throws ValueDoesNotMatchTypeException
      Constructor for a new EnumValue.
      Parameters:
      enumType - the Enum which defines the specific type of this EnumValue
      value - the enum value
      Throws:
      ValueDoesNotMatchTypeException - in case of type problems
  • Method Details

    • getValue

      public EnumLiteral getValue()
      Getter for the value. Not implemented yet.
      Specified by:
      getValue in class Value
      Returns:
      null
    • accept

      public void accept(IValueVisitor visitor)
      Description copied from class: Value
      Abstract accept method.
      Specified by:
      accept in class Value
      Parameters:
      visitor - The visitor
    • setValue

      public void setValue(Object value) throws ValueDoesNotMatchTypeException
      Description copied from class: Value
      Abstract setValue-method.
      Specified by:
      setValue in class Value
      Parameters:
      value - the value to set.
      Throws:
      ValueDoesNotMatchTypeException - if the given value does not match this type
    • isConfigured

      public boolean isConfigured()
      Description copied from class: Value
      Abstract Method to check whether a value is configured.
      Specified by:
      isConfigured in class Value
      Returns:
      true = it is configured / false = it is not
    • clone

      public Value clone()
      Description copied from class: Value
      Clones the this value.
      Overrides:
      clone in class Value
      Returns:
      the clone of the value
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Value
    • equals

      public boolean equals(Object object)
      Overrides:
      equals in class Value
    • equalsPartially

      public boolean equalsPartially(Value value)
      Description copied from class: Value
      Returns whether the provided value is partially equal to this value, i.e., whether the nested elements of value (if they exist) have the same contents as in this value. Other values of this value are not considered. The check is transitive on nested elements. Please consider that this method is not symmetric as opposed to equals. This method is important to cope with default values.
      Specified by:
      equalsPartially in class Value
      Parameters:
      value - the value to be checked for partial equality.
      Returns:
      true if value is partially equal to this, false else