Class Value
java.lang.Object
net.ssehub.easy.varModel.model.values.Value
- Direct Known Subclasses:
BasisDatatypeValue,EnumValue,ListWrapperValue,MetaTypeValue,NullValue,ReferenceValue,StructuredValue
Basis value class.
- Author:
- Marcel Lueder, El-Sharkawy, Holger Eichelberger
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidaccept(IValueVisitor visitor) Abstract accept method.clone()Clones the this value.booleanstatic booleanabstract 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.static booleanequalsPartially(Value v1, Value v2) Returns whetherv1andv2areequalsPartially(Value)partially equal considering the case thatv1may be null.Returns the data type explicitly contained in this value.getType()Returns the Datatype of this Value.abstract ObjectgetValue()Abstract getValue method.Returns the value parent.inthashCode()abstract booleanAbstract Method to check whether a value is configured.abstract voidAbstract setValue-method.voidsetValueParent(IValueParent parent) Changes the value parent.protected StringstringValueOf(Object object) Converts a object value to a string.toString()
-
Field Details
-
LOGGER
private static final net.ssehub.easy.basics.logger.EASyLoggerFactory.EASyLogger LOGGER -
origin
-
-
Constructor Details
-
Value
Value()Constructor for serialization. -
Value
Constructor.- Parameters:
origin- the origin datatype.
-
-
Method Details
-
getValue
Abstract getValue method. The result of this method must comply to the input conventions ofValueFactoryand the constructor of the respective implementing class.- Returns:
- the Value of the Datatype
-
accept
Abstract accept method.- Parameters:
visitor- The visitor
-
setValue
Abstract setValue-method.- Parameters:
value- the value to set.- Throws:
ValueDoesNotMatchTypeException- if the given value does not match this type
-
getType
Returns the Datatype of this Value. The datatype should match to the type of this value.- Returns:
- Related datatype of this value.
-
isConfigured
public abstract boolean isConfigured()Abstract Method to check whether a value is configured.- Returns:
- true = it is configured / false = it is not
-
stringValueOf
Converts a object value to a string.- Parameters:
object- the object to convert- Returns:
- the converted object
-
clone
Clones the this value. -
getContainedType
Returns the data type explicitly contained in this value. This is typically a meta value, i.e. a type expression.- Returns:
- the contained type or null if there is none
-
toString
-
equalsPartially
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. 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.- Parameters:
value- the value to be checked for partial equality.- Returns:
trueifvalueis partially equal to this,falseelse
-
equalsPartially
Returns whetherv1andv2areequalsPartially(Value)partially equal considering the case thatv1may be null.- Parameters:
v1- the first value (may be null)v2- the second value (may be null)- Returns:
trueifv1andv2are considered to be partially equal,falseelse, i.e., whetherv2is a partial value ofv1
-
equals
- Parameters:
v1- the first value (may be null)v2- the second value (may be null)- Returns:
trueifv1andv2are considered to be equal,falseelse, i.e., whetherv2is the same value asv1
-
hashCode
public int hashCode() -
equals
-
setValueParent
Changes the value parent.- Parameters:
parent- the parent
-
getValueParent
Returns the value parent.- Returns:
- the parent (may be null for none)
-