Package com.tngtech.archunit.base
Class Optional<T>
java.lang.Object
com.tngtech.archunit.base.Optional<T>
@PublicAPI(usage=ACCESS) public abstract class Optional<T> extends java.lang.Object
-
Method Summary
Modifier and Type Method Description static <T> Optional<T>
absent()
abstract java.util.Set<T>
asSet()
static <T> Optional<T>
fromNullable(T object)
abstract T
get()
abstract T
getOrThrow(Supplier<? extends java.lang.RuntimeException> exceptionSupplier)
abstract T
getOrThrow(java.lang.RuntimeException e)
Deprecated.abstract boolean
isPresent()
static <T> Optional<T>
of(T object)
abstract Optional<T>
or(Optional<? extends T> value)
abstract T
or(T value)
abstract T
orNull()
abstract <U> Optional<U>
transform(Function<? super T,U> function)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Method Details
-
of
-
fromNullable
-
absent
-
isPresent
-
get
-
getOrThrow
Deprecated.UsegetOrThrow(Supplier)
instead (this version always instantiates the exception, no matter if needed) -
getOrThrow
@PublicAPI(usage=ACCESS) public abstract T getOrThrow(Supplier<? extends java.lang.RuntimeException> exceptionSupplier) -
transform
-
orNull
-
or
-
or
-
asSet
-
getOrThrow(Supplier)
instead (this version always instantiates the exception, no matter if needed)