Class ConditionOutcome
java.lang.Object
org.springframework.boot.autoconfigure.condition.ConditionOutcome
Outcome for a condition match, including log message.
- Since:
- 1.0.0
- Author:
- Phillip Webb
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConditionOutcome(boolean match, String message) Create a newConditionOutcomeinstance.ConditionOutcome(boolean match, ConditionMessage message) Create a newConditionOutcomeinstance. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturn an outcome message ornull.Return an outcome message ornull.inthashCode()static ConditionOutcomeinverse(ConditionOutcome outcome) Return the inverse of the specified condition outcome.booleanisMatch()Returntrueif the outcome was a match.static ConditionOutcomematch()Create a newConditionOutcomeinstance for a 'match'.static ConditionOutcomeCreate a newConditionOutcomeinstance for 'match'.static ConditionOutcomematch(ConditionMessage message) Create a newConditionOutcomeinstance for 'match'.static ConditionOutcomeCreate a newConditionOutcomeinstance for 'no match'.static ConditionOutcomenoMatch(ConditionMessage message) Create a newConditionOutcomeinstance for 'no match'.toString()
-
Constructor Details
-
ConditionOutcome
Create a newConditionOutcomeinstance. For more consistent messages consider usingConditionOutcome(boolean, ConditionMessage).- Parameters:
match- if the condition is a matchmessage- the condition message
-
ConditionOutcome
Create a newConditionOutcomeinstance.- Parameters:
match- if the condition is a matchmessage- the condition message
-
-
Method Details
-
match
Create a newConditionOutcomeinstance for a 'match'.- Returns:
- the
ConditionOutcome
-
match
Create a newConditionOutcomeinstance for 'match'. For more consistent messages consider usingmatch(ConditionMessage).- Parameters:
message- the message- Returns:
- the
ConditionOutcome
-
match
Create a newConditionOutcomeinstance for 'match'.- Parameters:
message- the message- Returns:
- the
ConditionOutcome
-
noMatch
Create a newConditionOutcomeinstance for 'no match'. For more consistent messages consider usingnoMatch(ConditionMessage).- Parameters:
message- the message- Returns:
- the
ConditionOutcome
-
noMatch
Create a newConditionOutcomeinstance for 'no match'.- Parameters:
message- the message- Returns:
- the
ConditionOutcome
-
isMatch
public boolean isMatch()Returntrueif the outcome was a match.- Returns:
trueif the outcome matches
-
getMessage
Return an outcome message ornull.- Returns:
- the message or
null
-
getConditionMessage
Return an outcome message ornull.- Returns:
- the message or
null
-
equals
-
hashCode
public int hashCode() -
toString
-
inverse
Return the inverse of the specified condition outcome.- Parameters:
outcome- the outcome to inverse- Returns:
- the inverse of the condition outcome
- Since:
- 1.3.0
-