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
ConstructorDescriptionConditionOutcome
(boolean match, String message) Create a newConditionOutcome
instance.ConditionOutcome
(boolean match, ConditionMessage message) Create a newConditionOutcome
instance. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Return an outcome message ornull
.Return an outcome message ornull
.int
hashCode()
static ConditionOutcome
inverse
(ConditionOutcome outcome) Deprecated, for removal: This API element is subject to removal in a future version.boolean
isMatch()
Returntrue
if the outcome was a match.static ConditionOutcome
match()
Create a newConditionOutcome
instance for a 'match'.static ConditionOutcome
Create a newConditionOutcome
instance for 'match'.static ConditionOutcome
match
(ConditionMessage message) Create a newConditionOutcome
instance for 'match'.static ConditionOutcome
Create a newConditionOutcome
instance for 'no match'.static ConditionOutcome
noMatch
(ConditionMessage message) Create a newConditionOutcome
instance for 'no match'.toString()
-
Constructor Details
-
ConditionOutcome
Create a newConditionOutcome
instance. For more consistent messages consider usingConditionOutcome(boolean, ConditionMessage)
.- Parameters:
match
- if the condition is a matchmessage
- the condition message
-
ConditionOutcome
Create a newConditionOutcome
instance.- Parameters:
match
- if the condition is a matchmessage
- the condition message
-
-
Method Details
-
match
Create a newConditionOutcome
instance for a 'match'.- Returns:
- the
ConditionOutcome
-
match
Create a newConditionOutcome
instance for 'match'. For more consistent messages consider usingmatch(ConditionMessage)
.- Parameters:
message
- the message- Returns:
- the
ConditionOutcome
-
match
Create a newConditionOutcome
instance for 'match'.- Parameters:
message
- the message- Returns:
- the
ConditionOutcome
-
noMatch
Create a newConditionOutcome
instance for 'no match'. For more consistent messages consider usingnoMatch(ConditionMessage)
.- Parameters:
message
- the message- Returns:
- the
ConditionOutcome
-
noMatch
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
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
@Deprecated(since="3.5.0", forRemoval=true) public static ConditionOutcome inverse(ConditionOutcome outcome) Deprecated, for removal: This API element is subject to removal in a future version.since 3.5.0 for removal in 3.7.0 in favor ofConditionOutcome(boolean, ConditionMessage)
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
-
ConditionOutcome(boolean, ConditionMessage)