public class ConditionOutcome
extends java.lang.Object
ConditionMessage| Constructor and Description |
|---|
ConditionOutcome(boolean match,
ConditionMessage message)
Create a new
ConditionOutcome instance. |
ConditionOutcome(boolean match,
java.lang.String message)
Create a new
ConditionOutcome instance. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
ConditionMessage |
getConditionMessage()
Return an outcome message or
null. |
java.lang.String |
getMessage()
Return an outcome message or
null. |
int |
hashCode() |
static ConditionOutcome |
inverse(ConditionOutcome outcome)
Return the inverse of the specified condition outcome.
|
boolean |
isMatch()
Return
true if the outcome was a match. |
static ConditionOutcome |
match()
Create a new
ConditionOutcome instance for a 'match'. |
static ConditionOutcome |
match(ConditionMessage message)
Create a new
ConditionOutcome instance for 'match'. |
static ConditionOutcome |
match(java.lang.String message)
Create a new
ConditionOutcome instance for 'match'. |
static ConditionOutcome |
noMatch(ConditionMessage message)
Create a new
ConditionOutcome instance for 'no match'. |
static ConditionOutcome |
noMatch(java.lang.String message)
Create a new
ConditionOutcome instance for 'no match'. |
java.lang.String |
toString() |
public ConditionOutcome(boolean match,
java.lang.String message)
ConditionOutcome instance. For more consistent messages
consider using ConditionOutcome(boolean, ConditionMessage).match - if the condition is a matchmessage - the condition messagepublic ConditionOutcome(boolean match,
ConditionMessage message)
ConditionOutcome instance.match - if the condition is a matchmessage - the condition messagepublic static ConditionOutcome match()
ConditionOutcome instance for a 'match'.ConditionOutcomepublic static ConditionOutcome match(java.lang.String message)
ConditionOutcome instance for 'match'. For more consistent
messages consider using match(ConditionMessage).message - the messageConditionOutcomepublic static ConditionOutcome match(ConditionMessage message)
ConditionOutcome instance for 'match'.message - the messageConditionOutcomepublic static ConditionOutcome noMatch(java.lang.String message)
ConditionOutcome instance for 'no match'. For more consistent
messages consider using noMatch(ConditionMessage).message - the messageConditionOutcomepublic static ConditionOutcome noMatch(ConditionMessage message)
ConditionOutcome instance for 'no match'.message - the messageConditionOutcomepublic boolean isMatch()
true if the outcome was a match.true if the outcome matchespublic java.lang.String getMessage()
null.nullpublic ConditionMessage getConditionMessage()
null.nullpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic static ConditionOutcome inverse(ConditionOutcome outcome)
outcome - the outcome to inverse