Class BooleanValue


public class BooleanValue extends BasisDatatypeValue
This class holds the value for the boolean.
Author:
lueder, Holger Eichelberger
  • Field Details

  • Constructor Details

    • BooleanValue

      protected BooleanValue(String value) throws ValueDoesNotMatchTypeException
      Constructor. 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(Boolean value)
      Creates a boolean value from the given boolean value.
      Parameters:
      value - the value to assign
  • Method Details

    • getValue

      public Boolean getValue()
      Getter for the value.
      Overrides:
      getValue in class BasisDatatypeValue
      Returns:
      the saved boolean
    • 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
    • accept

      public void accept(IValueVisitor visitor)
      Description copied from class: Value
      Abstract accept method.
      Specified by:
      accept in class Value
      Parameters:
      visitor - The visitor
    • 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
    • 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 Boolean toValue(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(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(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
    • hashCode

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

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