Class Bool

java.lang.Object
org.spincast.core.utils.Bool

public class Bool extends Object
Boolean object that can't be autoboxed.

Java's Boolean objects are quite dangerous because of autoboxing. For example, if(myBooleanObject) will throw an NullPointerException if it's null.

This Bool class allows to carry a null, true or false value, without the autoboxing dangers.

  • Field Details

    • TRUE

      public static final Bool TRUE
    • FALSE

      public static final Bool FALSE
  • Method Details

    • from

      public static Bool from(boolean val)
    • getBoolean

      public boolean getBoolean()
    • toString

      public String toString()
      Overrides:
      toString in class Object