Package org.postgresql.pljava.internal
Class Checked.OptionalBoolean
- java.lang.Object
-
- org.postgresql.pljava.internal.Checked.OptionalBase
-
- org.postgresql.pljava.internal.Checked.OptionalBoolean
-
public static class Checked.OptionalBoolean extends Checked.OptionalBase
A container object which may or may not contain aboolean
value.
-
-
Field Summary
Fields Modifier and Type Field Description static Checked.OptionalBoolean
EMPTY
An emptyOptionalBoolean
, for convenience; not to be used in identity-sensitive operations.static Checked.OptionalBoolean
FALSE
AnOptionalBoolean
containingfalse
, for convenience; not to be used in identity-sensitive operations.static Checked.OptionalBoolean
TRUE
AnOptionalBoolean
containingtrue
, for convenience; not to be used in identity-sensitive operations.
-
Method Summary
Modifier and Type Method Description boolean
getAsBoolean()
<E extends Throwable>
voidifPresent(Checked.BooleanConsumer<? extends E> action)
<E extends Throwable>
voidifPresentOrElse(Checked.BooleanConsumer<? extends E> action, Checked.Runnable<? extends E> emptyAction)
static Checked.OptionalBoolean
of(boolean value)
boolean
orElse(boolean other)
<E extends Throwable>
booleanorElseGet(Checked.BooleanSupplier<? extends E> supplier)
<E extends Throwable>
booleanorElseThrow(Checked.Supplier<? extends E,? extends E> exceptionSupplier)
-
Methods inherited from class org.postgresql.pljava.internal.Checked.OptionalBase
equals, hashCode, isPresent, ofNullable, ofNullable, ofNullable, ofNullable, ofNullable, ofNullable, ofNullable, ofNullable, toString
-
-
-
-
Field Detail
-
EMPTY
public static final Checked.OptionalBoolean EMPTY
An emptyOptionalBoolean
, for convenience; not to be used in identity-sensitive operations.
-
FALSE
public static final Checked.OptionalBoolean FALSE
AnOptionalBoolean
containingfalse
, for convenience; not to be used in identity-sensitive operations.
-
TRUE
public static final Checked.OptionalBoolean TRUE
AnOptionalBoolean
containingtrue
, for convenience; not to be used in identity-sensitive operations.
-
-
Method Detail
-
of
public static Checked.OptionalBoolean of(boolean value)
-
getAsBoolean
public boolean getAsBoolean()
-
ifPresent
public <E extends Throwable> void ifPresent(Checked.BooleanConsumer<? extends E> action) throws E extends Throwable
- Throws:
E extends Throwable
-
ifPresentOrElse
public <E extends Throwable> void ifPresentOrElse(Checked.BooleanConsumer<? extends E> action, Checked.Runnable<? extends E> emptyAction) throws E extends Throwable
- Throws:
E extends Throwable
-
orElse
public boolean orElse(boolean other)
-
orElseGet
public <E extends Throwable> boolean orElseGet(Checked.BooleanSupplier<? extends E> supplier) throws E extends Throwable
- Throws:
E extends Throwable
-
orElseThrow
public <E extends Throwable> boolean orElseThrow(Checked.Supplier<? extends E,? extends E> exceptionSupplier) throws E extends Throwable
- Throws:
E extends Throwable
-
-