Enum Class NullBool

java.lang.Object
java.lang.Enum<NullBool>
ch.andre601.advancedserverlist.api.objects.NullBool
All Implemented Interfaces:
Serializable, Comparable<NullBool>, Constable

public enum NullBool extends Enum<NullBool>
Enum used to return a Boolean Value with a fallback, should the boolean be null.
  • Enum Constant Details

    • TRUE

      public static final NullBool TRUE
      Representation of the Boolean value true.
    • FALSE

      public static final NullBool FALSE
      Representation of the Boolean value false.
    • NOT_SET

      public static final NullBool NOT_SET
      Representation of a null Boolean value.
  • Method Details

    • values

      public static NullBool[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static NullBool valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • resolve

      public static NullBool resolve(Boolean bool)

      Returns a NullBool Instance based on the provided Boolean instance:

      Parameters:
      bool - Boolean to obtain a NullBool Instance from.
      Returns:
      NullBool Instance based on the provided Boolean value.
    • isNotSet

      public boolean isNotSet()
      Returns whether the NullBool Instance is NullBool.NOT_SET.
      Returns:
      true if the Instance is equal to NullBool.NOT_SET.
    • getOrDefault

      public boolean getOrDefault(boolean def)
      Returns the NullBool's Boolean value or the provided def value, should the Instance be equal to NullBool.NOT_SET.
      Parameters:
      def - Default boolean value to return, should the NullBool instance be equal to NullBool.NOT_SET.
      Returns:
      true or false based on the NullBool's Instance and the provided def value.