/** Creates an absent whose {@link #get()} throws a {@link RuntimeException} * generated on demand from the given supplier */ public static <T> Maybe<T> absent(final Supplier<? extends RuntimeException> exceptionSupplier) { return new Absent<T>(Preconditions.checkNotNull(exceptionSupplier)); }
/** Returns an absent indicator. No message is available and access does not include any reference to this creation. * Therefore it is fast and simple, but hard to work with if someone might {@link #get()} it and want a useful exception. * See also {@link #absentNoTrace(String)} to include a message with very low overhead, * or {@link #absentWithTrace(String)} or {@link #absent(Throwable)} for more control over the exception thrown. */ public static <T> Maybe<T> absent() { return new Maybe.Absent<T>(); }