Class PrimitiveBooleanDatatype

All Implemented Interfaces:
Comparable<Datatype>, Datatype, ValueDatatype

public class PrimitiveBooleanDatatype extends AbstractPrimitiveDatatype
Datatype for the primitive boolean.
  • Constructor Details

    • PrimitiveBooleanDatatype

      public PrimitiveBooleanDatatype()
  • Method Details

    • getName

      public String getName()
      Description copied from interface: Datatype
      Returns the datatype's name.
    • getQualifiedName

      public String getQualifiedName()
      Description copied from interface: Datatype
      Returns the datatype's qualified name.

      The qualified name identifies the datatype.

    • getDefaultValue

      public String getDefaultValue()
      Description copied from interface: ValueDatatype
      Returns the datatype's default value. For datatypes representing objects the method returns null. For datatypes representing Java primitives the Java default value is returned, e.g. 0 for int.
      See Also:
    • getWrapperType

      public ValueDatatype getWrapperType()
      Description copied from interface: ValueDatatype
      If this datatype represents a primitive type, this method returns the datatype that represents the wrapper class. Returns null if this datatype does not represent a primitive.
    • getValue

      public Object getValue(String value)
      Description copied from interface: ValueDatatype
      This method parses the given string and returns the value as an instance of the class this value datatype represents.

      Use with caution: During development time Faktor-IPS maintains all values with their string representation. This allows to change the value's datatype without the need to convert the value from one class to another (e.g. if the string representation is 42 you can change the datatype from integer to string without converting the integer object to a string object.

      May throw different exceptions if the given string does not represent any value, for example a NumberFormatException when "twelve" is passed to PrimitiveIntegerDatatype.getValue(String).

      Specified by:
      getValue in interface ValueDatatype
      Specified by:
      getValue in class AbstractPrimitiveDatatype
      Parameters:
      value - the string representation of a value
      Returns:
      the value as instance of the class this datatype represents
      See Also:
    • supportsCompare

      public boolean supportsCompare()
      Returns:
      true if this datatype is able to compare two values.