Class ConditionOutcome
- java.lang.Object
- org.springframework.boot.autoconfigure.condition.ConditionOutcome
public class ConditionOutcome extends Object
Outcome for a condition match, including log message.- See Also:
ConditionMessage
Constructor Summary
Constructors Constructor Description ConditionOutcome(boolean match, String message)
Create a newConditionOutcome
instance.ConditionOutcome(boolean match, ConditionMessage message)
Create a newConditionOutcome
instance.
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
ConditionMessage
getConditionMessage()
Return an outcome message ornull
.String
getMessage()
Return an outcome message ornull
.int
hashCode()
static ConditionOutcome
inverse(ConditionOutcome outcome)
Return the inverse of the specified condition outcome.boolean
isMatch()
Returntrue
if the outcome was a match.static ConditionOutcome
match()
Create a newConditionOutcome
instance for a 'match'.static ConditionOutcome
match(String message)
Create a newConditionOutcome
instance for 'match'.static ConditionOutcome
match(ConditionMessage message)
Create a newConditionOutcome
instance for 'match'.static ConditionOutcome
noMatch(String message)
Create a newConditionOutcome
instance for 'no match'.static ConditionOutcome
noMatch(ConditionMessage message)
Create a newConditionOutcome
instance for 'no match'.String
toString()
Constructor Detail
ConditionOutcome
public ConditionOutcome(boolean match, String message)
Create a newConditionOutcome
instance. For more consistent messages consider usingConditionOutcome(boolean, ConditionMessage)
.- Parameters:
match
- if the condition is a matchmessage
- the condition message
ConditionOutcome
public ConditionOutcome(boolean match, ConditionMessage message)
Create a newConditionOutcome
instance.- Parameters:
match
- if the condition is a matchmessage
- the condition message
Method Detail
match
public static ConditionOutcome match()
Create a newConditionOutcome
instance for a 'match'.- Returns:
- the
ConditionOutcome
match
public static ConditionOutcome match(String message)
Create a newConditionOutcome
instance for 'match'. For more consistent messages consider usingmatch(ConditionMessage)
.- Parameters:
message
- the message- Returns:
- the
ConditionOutcome
match
public static ConditionOutcome match(ConditionMessage message)
Create a newConditionOutcome
instance for 'match'.- Parameters:
message
- the message- Returns:
- the
ConditionOutcome
noMatch
public static ConditionOutcome noMatch(String message)
Create a newConditionOutcome
instance for 'no match'. For more consistent messages consider usingnoMatch(ConditionMessage)
.- Parameters:
message
- the message- Returns:
- the
ConditionOutcome
noMatch
public static ConditionOutcome noMatch(ConditionMessage message)
Create a newConditionOutcome
instance for 'no match'.- Parameters:
message
- the message- Returns:
- the
ConditionOutcome
isMatch
public boolean isMatch()
Returntrue
if the outcome was a match.- Returns:
true
if the outcome matches
getMessage
public String getMessage()
Return an outcome message ornull
.- Returns:
- the message or
null
getConditionMessage
public ConditionMessage getConditionMessage()
Return an outcome message ornull
.- Returns:
- the message or
null
inverse
public static ConditionOutcome inverse(ConditionOutcome outcome)
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