Package org.postgresql.pljava.internal
Class Checked.OptionalFloat
- java.lang.Object
-
- org.postgresql.pljava.internal.Checked.OptionalBase
-
- org.postgresql.pljava.internal.Checked.OptionalFloat
-
public static class Checked.OptionalFloat extends Checked.OptionalBase
A container object which may or may not contain afloat
value.
-
-
Field Summary
Fields Modifier and Type Field Description static Checked.OptionalFloat
EMPTY
An emptyOptionalFloat
, for convenience; not to be used in identity-sensitive operations.
-
Method Summary
Modifier and Type Method Description float
getAsFloat()
<E extends Throwable>
voidifPresent(Checked.FloatConsumer<? extends E> action)
<E extends Throwable>
voidifPresentOrElse(Checked.FloatConsumer<? extends E> action, Checked.Runnable<? extends E> emptyAction)
static Checked.OptionalFloat
of(float value)
float
orElse(float other)
<E extends Throwable>
floatorElseGet(Checked.FloatSupplier<? extends E> supplier)
<E extends Throwable>
floatorElseThrow(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.OptionalFloat EMPTY
An emptyOptionalFloat
, for convenience; not to be used in identity-sensitive operations.
-
-
Method Detail
-
of
public static Checked.OptionalFloat of(float value)
-
getAsFloat
public float getAsFloat()
-
ifPresent
public <E extends Throwable> void ifPresent(Checked.FloatConsumer<? extends E> action) throws E extends Throwable
- Throws:
E extends Throwable
-
ifPresentOrElse
public <E extends Throwable> void ifPresentOrElse(Checked.FloatConsumer<? extends E> action, Checked.Runnable<? extends E> emptyAction) throws E extends Throwable
- Throws:
E extends Throwable
-
orElse
public float orElse(float other)
-
orElseGet
public <E extends Throwable> float orElseGet(Checked.FloatSupplier<? extends E> supplier) throws E extends Throwable
- Throws:
E extends Throwable
-
orElseThrow
public <E extends Throwable> float orElseThrow(Checked.Supplier<? extends E,? extends E> exceptionSupplier) throws E extends Throwable
- Throws:
E extends Throwable
-
-