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 Summary
Fields Modifier and Type Field Description private EnumLiteralliteral
-
Constructor Summary
Constructors Modifier Constructor Description (package private)EnumValue()Constructor for serialization.protectedEnumValue(Enum enumType)Constructor for a new EnumValue.protectedEnumValue(Enum enumType, java.lang.Object value)Constructor for a new EnumValue.protectedEnumValue(Enum enumType, EnumLiteral literal)Constructor for a new EnumValue.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(IValueVisitor visitor)Abstract accept method.Valueclone()Clones the this value.booleanequals(java.lang.Object object)booleanequalsPartially(Value value)Returns whether the providedvalueis partially equal to this value, i.e., whether the nested elements ofvalue(if they exist) have the same contents as in this value.EnumLiteralgetValue()Getter for the value.inthashCode()booleanisConfigured()Abstract Method to check whether a value is configured.voidsetValue(java.lang.Object value)Abstract setValue-method.-
Methods inherited from class net.ssehub.easy.varModel.model.values.Value
equals, equalsPartially, getContainedType, getType, getValueParent, setValueParent, stringValueOf, toString
-
-
-
-
Field Detail
-
literal
private EnumLiteral literal
-
-
Constructor Detail
-
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 EnumValueliteral- the initial value for the literal
-
EnumValue
protected EnumValue(Enum enumType, java.lang.Object value) throws ValueDoesNotMatchTypeException
Constructor for a new EnumValue.- Parameters:
enumType- the Enum which defines the specific type of this EnumValuevalue- the enum value- Throws:
ValueDoesNotMatchTypeException- in case of type problems
-
-
Method Detail
-
getValue
public EnumLiteral getValue()
Getter for the value. Not implemented yet.
-
accept
public void accept(IValueVisitor visitor)
Description copied from class:ValueAbstract accept method.
-
setValue
public void setValue(java.lang.Object value) throws ValueDoesNotMatchTypeExceptionDescription copied from class:ValueAbstract setValue-method.- Specified by:
setValuein classValue- 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:ValueAbstract Method to check whether a value is configured.- Specified by:
isConfiguredin classValue- Returns:
- true = it is configured / false = it is not
-
equalsPartially
public boolean equalsPartially(Value value)
Description copied from class:ValueReturns whether the providedvalueis partially equal to this value, i.e., whether the nested elements ofvalue(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 toequals. This method is important to cope with default values.- Specified by:
equalsPartiallyin classValue- Parameters:
value- the value to be checked for partial equality.- Returns:
trueifvalueis partially equal to this,falseelse
-
-