Class PrimitiveBooleanHelper

All Implemented Interfaces:
BaseDatatypeHelper<JavaCodeFragment>, DatatypeHelper, PrimitiveDatatypeHelper

public class PrimitiveBooleanHelper extends AbstractPrimitiveDatatypeHelper
  • Constructor Details

    • PrimitiveBooleanHelper

      public PrimitiveBooleanHelper()
      Constructs a new helper.
    • PrimitiveBooleanHelper

      public PrimitiveBooleanHelper(PrimitiveBooleanDatatype datatype)
      Constructs a new helper for the given primitive boolean datatype.
      Throws:
      IllegalArgumentException - if datatype is null.
  • Method Details

    • getWrapperTypeHelper

      public DatatypeHelper getWrapperTypeHelper()
      Description copied from interface: PrimitiveDatatypeHelper
      Retrieves the DatatypeHelper for the wrapper type of the primitive type for which this helper is responsible.
      Returns:
      The DatatypeHelper of the not primitive wrapper type
    • getJavaClassName

      public String getJavaClassName()
      Description copied from interface: DatatypeHelper
      Returns the qualified Java class name the datatype represents.
    • newInstance

      public JavaCodeFragment newInstance(String value)
      Description copied from interface: DatatypeHelper
      Returns a JavaCodeFragment with sourcecode that creates an instance of the datatype's Java class with the given value. If the value is null the fragment's sourcecode is either the String "null" or the sourcecode to get an instance of the appropriate null object.
    • toWrapper

      public JavaCodeFragment toWrapper(JavaCodeFragment expression)
      Description copied from interface: PrimitiveDatatypeHelper
      Given a JavaCodeFragment containing an expression of the primitive type this is a helper for, returns a JavaCodeFragment that converts the given expression to the appropriate wrapper class.
    • valueOfExpression

      protected JavaCodeFragment valueOfExpression(String expression)
      Description copied from class: AbstractDatatypeHelper
      This method is supposed to be overridden by subclasses.

      It is used within the newInstanceFromExpression(String) method. It returns a JavaCodeFragment with sourcecode that creates an instance of the datatype's Java class with the given expression.

      If the expression is null the fragment's sourcecode is either the String "null" or the sourcecode to get an instance of the appropriate null object. Preconditions: Expression may not be null or empty. When evaluated the expression must return a String.

      Specified by:
      valueOfExpression in class AbstractDatatypeHelper