|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.confluence.core.MaybeNot<T>
T
- the type Maybe
is wrappingpublic abstract class MaybeNot<T>
Helps constructing the left, erroneous case of a
.
Maybe
Method Summary | ||
---|---|---|
static
|
becauseOf(java.lang.String message,
java.lang.Object... args)
Constructs a Maybe which will escape with the given message on a call. |
|
static
|
becauseOfException(java.lang.Exception exception)
Constructs a Maybe which will escape with the given exception on a call. |
|
static
|
becauseOfNoResult(com.atlassian.fugue.Maybe<?> maybe)
Will cast the given Maybe to one with the expected parametrisation. |
|
boolean |
exists(com.google.common.base.Predicate<T> p)
|
|
boolean |
forall(com.google.common.base.Predicate<T> p)
|
|
void |
foreach(com.atlassian.fugue.Effect<T> effect)
|
|
|
getOrElse(B other)
|
|
T |
getOrElse(com.google.common.base.Supplier<T> supplier)
|
|
T |
getOrError(com.google.common.base.Supplier<java.lang.String> msg)
|
|
T |
getOrNull()
|
|
boolean |
isDefined()
|
|
boolean |
isEmpty()
|
|
java.util.Iterator<T> |
iterator()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.atlassian.fugue.Maybe |
---|
get |
Method Detail |
---|
public static <T> com.atlassian.fugue.Maybe<T> becauseOfNoResult(com.atlassian.fugue.Maybe<?> maybe)
Maybe
to one with the expected parametrisation.
This has to be
since it is expected to escape on a Maybe.isEmpty()
Maybe.get()
call.
maybe
- to be casted to the target type
Maybe
adhering to the taget typepublic static <T> com.atlassian.fugue.Maybe<T> becauseOf(java.lang.String message, java.lang.Object... args)
Maybe
which will escape with the given message on a Maybe.get()
call.
message
- the message used for the escape, may be formatted for application of String.format(String, Object...)
args
- the arguments used for formatting the message, may be null
Maybe
escaping on realizationpublic static <T> com.atlassian.fugue.Maybe<T> becauseOfException(java.lang.Exception exception)
Maybe
which will escape with the given exception on a Maybe.get()
call.
exception
- the exception to be thrown, will be nested in a RuntimeException
if it is checked
public T getOrError(com.google.common.base.Supplier<java.lang.String> msg)
getOrError
in interface com.atlassian.fugue.Maybe<T>
public T getOrElse(com.google.common.base.Supplier<T> supplier)
getOrElse
in interface com.atlassian.fugue.Maybe<T>
public <B extends T> T getOrElse(B other)
getOrElse
in interface com.atlassian.fugue.Maybe<T>
public void foreach(com.atlassian.fugue.Effect<T> effect)
foreach
in interface com.atlassian.fugue.Effect.Applicant<T>
public T getOrNull()
getOrNull
in interface com.atlassian.fugue.Maybe<T>
public boolean exists(com.google.common.base.Predicate<T> p)
exists
in interface com.atlassian.fugue.Maybe<T>
public java.util.Iterator<T> iterator()
iterator
in interface com.atlassian.fugue.Maybe<T>
iterator
in interface java.lang.Iterable<T>
public boolean forall(com.google.common.base.Predicate<T> p)
forall
in interface com.atlassian.fugue.Maybe<T>
public boolean isEmpty()
isEmpty
in interface com.atlassian.fugue.Maybe<T>
public boolean isDefined()
isDefined
in interface com.atlassian.fugue.Maybe<T>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |