public class ThrowsCondition extends SpecificationClause
The JSON serialization of this class is used to read the specifications for an operation given
using the --specifications
command-line option. The JSON should include a JSON object
labeled by the name of each field of this class, as in
{ "exception": "java.lang.IllegalStateException", "description": "throws IllegalStateException if the connection is already open", "guard": { "condition": "receiver.isOpen()", "description": "if the connection is already open" } }See
Guard
for details on specifying guards.Modifier and Type | Field and Description |
---|---|
private @ClassGetName java.lang.String |
exceptionType
The fully-qualified binary name of the type of the expected exception.
|
Modifier | Constructor and Description |
---|---|
private |
ThrowsCondition()
Gson serialization requires a default constructor.
|
|
ThrowsCondition(java.lang.String description,
Guard guard,
@ClassGetName java.lang.String exceptionType)
Creates a
ThrowsCondition representing an exception expected when the guard is true. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(@Nullable java.lang.Object object) |
@ClassGetName java.lang.String |
getExceptionTypeName()
Returns the exception type name for this
ThrowsCondition . |
int |
hashCode() |
java.lang.String |
toString() |
getDescription, getGuard
@SerializedName(value="exception") private final @ClassGetName java.lang.String exceptionType
private ThrowsCondition()
public ThrowsCondition(java.lang.String description, Guard guard, @ClassGetName java.lang.String exceptionType)
ThrowsCondition
representing an exception expected when the guard is true.description
- the description of the conditionguard
- the guard for the specificationexceptionType
- the expected exception typepublic @ClassGetName java.lang.String getExceptionTypeName()
ThrowsCondition
.public boolean equals(@Nullable java.lang.Object object)
equals
in class SpecificationClause
public int hashCode()
hashCode
in class SpecificationClause
public java.lang.String toString()
toString
in class java.lang.Object