Class BooleanValue
- java.lang.Object
-
- net.ssehub.easy.varModel.model.values.Value
-
- net.ssehub.easy.varModel.model.values.BasisDatatypeValue
-
- net.ssehub.easy.varModel.model.values.BooleanValue
-
public class BooleanValue extends BasisDatatypeValue
This class holds the value for the boolean.- Author:
- lueder, Holger Eichelberger
-
-
Field Summary
Fields Modifier and Type Field Description static BooleanValueFALSEstatic BooleanValueTRUEprivate java.lang.Booleanvalue
-
Constructor Summary
Constructors Modifier Constructor Description protectedBooleanValue()Argumentless constructor representing the type itself.protectedBooleanValue(java.lang.Boolean value)Creates a boolean value from the given boolean value.protectedBooleanValue(java.lang.String value)Constructor.
-
Method Summary
All Methods Static 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)java.lang.BooleangetValue()Getter for the value.inthashCode()booleanisConfigured()Abstract Method to check whether a value is configured.voidsetValue(java.lang.Object value)Abstract setValue-method.static BooleanValuetoBooleanValue(boolean value)Converts a Java boolean into an IVML boolean value.static BooleanValuetoBooleanValue(java.lang.String value)Converts a String ("true", "false") into an IVML boolean value.static BooleanValuetoBooleanValueEx(java.lang.String value)Converts a String ("true", "false") into an IVML boolean value.private static java.lang.BooleantoValue(java.lang.Object value)Converts a String ("true", "false") into an IVML Boolean value.-
Methods inherited from class net.ssehub.easy.varModel.model.values.BasisDatatypeValue
equalsPartially
-
Methods inherited from class net.ssehub.easy.varModel.model.values.Value
equals, equalsPartially, getContainedType, getType, getValueParent, setValueParent, stringValueOf, toString
-
-
-
-
Field Detail
-
TRUE
public static final BooleanValue TRUE
-
FALSE
public static final BooleanValue FALSE
-
value
private java.lang.Boolean value
-
-
Constructor Detail
-
BooleanValue
protected BooleanValue(java.lang.String value) throws ValueDoesNotMatchTypeExceptionConstructor. Please avoid this constructor and use the constants instead.- Parameters:
value- Value of the Datatype- Throws:
ValueDoesNotMatchTypeException- if the given value does not match this type
-
BooleanValue
protected BooleanValue()
Argumentless constructor representing the type itself.
-
BooleanValue
protected BooleanValue(java.lang.Boolean value)
Creates a boolean value from the given boolean value.- Parameters:
value- the value to assign
-
-
Method Detail
-
getValue
public java.lang.Boolean getValue()
Getter for the value.- Overrides:
getValuein classBasisDatatypeValue- Returns:
- the saved boolean
-
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
-
accept
public void accept(IValueVisitor visitor)
Description copied from class:ValueAbstract accept method.
-
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
-
toBooleanValue
public static final BooleanValue toBooleanValue(boolean value)
Converts a Java boolean into an IVML boolean value. To some degree, this bypasses the value factory but - as the result is obvious, but also simplifies some (evaluation) code.- Parameters:
value- the value to be converted- Returns:
- the IVML value
-
toValue
private static final java.lang.Boolean toValue(java.lang.Object value)
Converts a String ("true", "false") into an IVML Boolean value.- Parameters:
value- the value to be converted- Returns:
- the IVML value (may be null if no match)
-
toBooleanValue
public static final BooleanValue toBooleanValue(java.lang.String value)
Converts a String ("true", "false") into an IVML boolean value. To some degree, this bypasses the value factory but - as the result is obvious, but also simplifies some (evaluation) code and may save resources.- Parameters:
value- the value to be converted- Returns:
- the IVML value (may be null if no match)
-
toBooleanValueEx
public static final BooleanValue toBooleanValueEx(java.lang.String value) throws ValueDoesNotMatchTypeException
Converts a String ("true", "false") into an IVML boolean value. To some degree, this bypasses the value factory but - as the result is obvious, but also simplifies some (evaluation) code and may save resources.- Parameters:
value- the value to be converted- Returns:
- the IVML value
- Throws:
ValueDoesNotMatchTypeException- in case that the value does not match
-
-