Class NullValue
java.lang.Object
net.ssehub.easy.varModel.model.values.Value
net.ssehub.easy.varModel.model.values.NullValue
Defines the null value. The null value is instance of
AnyType.- Author:
- Holger Eichelberger
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDefines the type of the singleton null value. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ValueThe only instance of the null value.static final ObjectThe value to be returned bygetValue(). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(IValueVisitor visitor) Abstract accept method.clone()Clones the this value.booleanbooleanequalsPartially(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.getValue()Abstract getValue method.inthashCode()booleanAbstract Method to check whether a value is configured.voidAbstract setValue-method.toString()Methods inherited from class net.ssehub.easy.varModel.model.values.Value
equals, equalsPartially, getContainedType, getType, getValueParent, setValueParent, stringValueOf
-
Field Details
-
INSTANCE
The only instance of the null value. -
VALUE
The value to be returned bygetValue(). null would be an alternative but this may break existing code.
-
-
Constructor Details
-
NullValue
private NullValue()Creates a null value. Not visible due to singleton constant character.
-
-
Method Details
-
getValue
Description copied from class:ValueAbstract getValue method. The result of this method must comply to the input conventions ofValueFactoryand the constructor of the respective implementing class. -
accept
Description copied from class:ValueAbstract accept method. -
setValue
Description 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
-
clone
Description copied from class:ValueClones the this value. -
hashCode
public int hashCode() -
equals
-
toString
-
equalsPartially
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
-