Class KiwiBooleans

java.lang.Object
org.kiwiproject.base.KiwiBooleans

public final class KiwiBooleans extends Object
Utilities for working with Boolean wrapper objects.
  • Method Details

    • toBooleanOrTrue

      public static boolean toBooleanOrTrue(@Nullable Boolean booleanObject)
      Return the boolean value of the Boolean when non-null, otherwise return true.
      Parameters:
      booleanObject - the possibly null Boolean object
      Returns:
      the boolean value of the Boolean object when non-null, otherwise true
    • toBooleanOrFalse

      public static boolean toBooleanOrFalse(@Nullable Boolean booleanObject)
      Return the boolean value of the Boolean when non-null, otherwise return false.
      Parameters:
      booleanObject - the possibly null Boolean object
      Returns:
      the boolean value of the Boolean object when non-null, otherwise false
    • toBooleanOrDefault

      public static boolean toBooleanOrDefault(@Nullable Boolean booleanObject, boolean defaultValue)
      Return the boolean value of the Boolean when non-null, otherwise return the default value.
      Parameters:
      booleanObject - the possibly null Boolean object
      defaultValue - the value to use when the Boolean argument is null
      Returns:
      the boolean value of the Boolean object when non-null, otherwise defaultValue