|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsbt.testing.OptionalThrowable
public final class OptionalThrowable
An optional Throwable
.
Constructor Summary | |
---|---|
OptionalThrowable()
Constructs an OptionalThrowable containing no Throwable . |
|
OptionalThrowable(java.lang.Throwable exception)
Constructs an OptionalThrowable containing a Throwable . |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o)
|
java.lang.Throwable |
get()
Returns the Throwable contained in this OptionalThrowable if defined, else throws IllegalStateException . |
int |
hashCode()
|
boolean |
isDefined()
Indicates whether this OptionalThrowable is "defined," i.e., contains a Throwable . |
boolean |
isEmpty()
Indicates whether this OptionalThrowable is "empty," i.e., contains no Throwable . |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public OptionalThrowable(java.lang.Throwable exception)
OptionalThrowable
containing a Throwable
.
public OptionalThrowable()
OptionalThrowable
containing no Throwable
.
Method Detail |
---|
public boolean isDefined()
OptionalThrowable
is "defined," i.e., contains a Throwable
.
OptionalThrowable
contains a Throwable
public boolean isEmpty()
OptionalThrowable
is "empty," i.e., contains no Throwable
.
OptionalThrowable
contains no Throwable
public java.lang.Throwable get()
Throwable
contained in this OptionalThrowable
if defined, else throws IllegalStateException
.
To avoid the IllegalStateException
, ensure isDefined
returns true
before calling this method.
Throwable
, if this OptionalThrowable
is defined
java.lang.IllegalStateException
- if this OptionalThrowable
is not defined.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |