Package panda.std
Class Option<T>
java.lang.Object
panda.std.Option<T>
- All Implemented Interfaces:
Serializable,Iterable<T>
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionassociateWith(Function<T, Option<R>> supplier) attempt(Class<E> throwableType, ThrowingSupplier<T, E> supplier) Deprecated.blank()booleancontentEquals(@Nullable Object to) boolean<R> Option<R>static <T> Option<T>static <T> Option<T>get()Deprecated.inthashCode()<S> Option<S>booleanbooleanbooleanisEmpty()booleanbooleaniterator()<R> Option<R><R> Option<R>final <R> Option<R>static <T> Option<T>none()static <T> Option<@NotNull T>of(T value) static <T> Option<T>ofOptional(Optional<T> optional) orElseSupply(Supplier<T> supplier) orNull()runThrowing(ThrowingRunnable<Exception> runnable) supplyThrowing(Class<E> throwableType, ThrowingSupplier<T, E> supplier) static <T> Option<T>supplyThrowing(ThrowingSupplier<T, Exception> supplier) toResult(E orElse) toStream()<R> PandaStream<R>toString()static <T> Option<T>static <T> Option<T>when(boolean condition, T value) static <T> Option<Completable<T>>withCompleted(T value) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
value
-
-
Constructor Details
-
Option
-
-
Method Details
-
none
-
blank
-
of
-
ofOptional
-
withCompleted
-
when
-
when
-
flatWhen
-
flatWhen
-
attempt
@Deprecated public static <T,E extends Throwable> Option<T> attempt(Class<E> throwableType, ThrowingSupplier<T, E> supplier) throws AttemptFailedExceptionDeprecated.- Throws:
AttemptFailedException
-
runThrowing
public static Option<Blank> runThrowing(ThrowingRunnable<Exception> runnable) throws AttemptFailedException - Throws:
AttemptFailedException
-
supplyThrowing
public static <T> Option<T> supplyThrowing(ThrowingSupplier<T, Exception> supplier) throws AttemptFailedException- Throws:
AttemptFailedException
-
supplyThrowing
public static <T,E extends Throwable> Option<T> supplyThrowing(Class<E> throwableType, ThrowingSupplier<T, E> supplier) throws AttemptFailedException- Throws:
AttemptFailedException
-
hashCode
public int hashCode() -
equals
-
contentEquals
-
toString
-
iterator
-
filter
-
filterNot
-
map
-
flatMap
-
associateWith
-
match
-
match
-
is
-
isNot
-
is
-
isNot
-
peek
-
peekIf
-
peekIfNot
-
onEmpty
-
orElse
-
orElse
-
orElse
-
orElseSupply
-
orThrow
- Throws:
E extends Throwable
-
orElseGet
-
orElseGet
-
getOrNull
Deprecated. -
orNull
-
get
- Throws:
NoSuchElementException
-
isPresent
public boolean isPresent() -
isDefined
public boolean isDefined() -
isEmpty
public boolean isEmpty() -
toStream
-
toStream
-
toJavaStream
-
toResult
-
toResult
-
toOptional
-