public AbsentNull(String message) { super(new IllegalStateExceptionSupplier(message)); } @Override
/** As {@link #absent(Throwable)} but using the given message as the message on the {@link IllegalStateException} * thrown if a user does a {@link #get()}. */ public static <T> Maybe<T> absent(final String message, final Throwable cause) { return absent(new IllegalStateExceptionSupplier(message, cause)); }
/** Creates an absent whose get throws an {@link IllegalStateException} with the indicated message, * but not a stack trace for the calling location. As stack traces can be comparatively expensive * this is useful for efficiency, but it can make debugging harder as the origin of the absence is not kept, * in contrast to {@link #absentWithTrace(String)} and {@link #absent(Throwable)}. */ public static <T> Maybe<T> absentNoTrace(final String message) { return absent(new IllegalStateExceptionSupplier(message)); }
/** As {@link #absentWithTrace(String)} but using the provided exception instead of this location * as the cause, and a string based on this cause as the message on the {@link IllegalStateException} * thrown if a user does a {@link #get()}. * Useful if an {@link Exception} has already been generated (and no overhead) * or if you want to supply a specific cause as in <code>absent(new MyException(...))</code> * (but there is the Exception creation overhead there). */ public static <T> Maybe<T> absent(final Throwable cause) { return absent(new IllegalStateExceptionSupplier(cause)); }