@Immutable public static final class u.OptionalBoolean extends Object implements Comparable<u.OptionalBoolean>, Immutable
| Modifier and Type | Field and Description |
|---|---|
static u.OptionalBoolean |
FALSE
Presents
true. |
static u.OptionalBoolean |
TRUE
Presents
true. |
public static final u.OptionalBoolean TRUE
true.public static final u.OptionalBoolean FALSE
true.public static u.OptionalBoolean empty()
public static u.OptionalBoolean of(boolean value)
value - public static u.OptionalBoolean ofNullable(Boolean val)
val - public boolean get()
throws NoSuchElementException
NoSuchElementException - the no such element exceptionpublic boolean isPresent()
public boolean isEmpty()
public <E extends Exception> u.OptionalBoolean ifPresent(Throwables.BooleanConsumer<E> action) throws E extends Exception
E - action - E - the eE extends Exceptionpublic <E extends Exception,E2 extends Exception> u.OptionalBoolean ifPresentOrElse(Throwables.BooleanConsumer<E> action, Throwables.Runnable<E2> emptyAction) throws E extends Exception, E2 extends Exception
E - E2 - action - emptyAction - E - the eE2 - the e2E extends Exceptionpublic <E extends Exception> u.OptionalBoolean filter(Throwables.BooleanPredicate<E> predicate) throws E extends Exception
E - predicate - E - the eE extends Exceptionpublic <E extends Exception> u.OptionalBoolean map(Throwables.BooleanUnaryOperator<E> mapper) throws E extends Exception
E - mapper - E - the eE extends Exceptionpublic <T,E extends Exception> u.Nullable<T> mapToObj(Throwables.BooleanFunction<T,E> mapper) throws E extends Exception
T - E - mapper - E - the eE extends Exceptionpublic <T,E extends Exception> u.Optional<T> mapToNonNull(Throwables.BooleanFunction<T,E> mapper) throws E extends Exception
E extends Exceptionpublic <E extends Exception> u.OptionalBoolean flatMap(Throwables.BooleanFunction<u.OptionalBoolean,E> mapper) throws E extends Exception
E - mapper - E - the eE extends Exceptionpublic <E extends Exception> u.OptionalBoolean or(Throwables.Supplier<u.OptionalBoolean,E> supplier) throws E extends Exception
E - supplier - E - the eE extends Exceptionpublic boolean orFalse()
public boolean orTrue()
public boolean orElseThrow()
throws NoSuchElementException
NoSuchElementException - the no such element exceptionpublic boolean orElse(boolean other)
other - public <E extends Exception> boolean orElseGet(Throwables.BooleanSupplier<E> other) throws E extends Exception
E - other - E - the eE extends Exceptionpublic <X extends Throwable> boolean orElseThrow(Supplier<? extends X> exceptionSupplier) throws X extends Throwable
X - exceptionSupplier - X - the xX extends Throwablepublic ImmutableList<Boolean> toImmutableList()
public ImmutableSet<Boolean> toImmutableSet()
public u.Optional<Boolean> boxed()
public int compareTo(u.OptionalBoolean optional)
compareTo in interface Comparable<u.OptionalBoolean>optional - public boolean equals(Object obj)
Copyright © 2021. All rights reserved.