Class ConditionMessage.Builder
- java.lang.Object
- org.springframework.boot.autoconfigure.condition.ConditionMessage.Builder
- Enclosing class:
- ConditionMessage
public final class ConditionMessage.Builder extends Object
Builder used to create aConditionMessage
for a condition.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConditionMessage
available(String item)
Indicates something is available.ConditionMessage
because(String reason)
Indicates the reason.ConditionMessage.ItemsBuilder
didNotFind(String article)
Indicate that one or more results were not found.ConditionMessage.ItemsBuilder
didNotFind(String singular, String plural)
Indicate that one or more results were found.ConditionMessage.ItemsBuilder
found(String article)
Indicate that one or more results were found.ConditionMessage.ItemsBuilder
found(String singular, String plural)
Indicate that one or more results were found.ConditionMessage
foundExactly(Object result)
Indicate that an exact result was found.ConditionMessage
notAvailable(String item)
Indicates something is not available.ConditionMessage
resultedIn(Object result)
Indicates a single result.
Method Detail
foundExactly
public ConditionMessage foundExactly(Object result)
Indicate that an exact result was found. For examplefoundExactly("foo")
results in the message "found foo".- Parameters:
result
- the result that was found- Returns:
- a built
ConditionMessage
found
public ConditionMessage.ItemsBuilder found(String article)
Indicate that one or more results were found. For examplefound("bean").items("x")
results in the message "found bean x".- Parameters:
article
- the article found- Returns:
- an
ConditionMessage.ItemsBuilder
found
public ConditionMessage.ItemsBuilder found(String singular, String plural)
Indicate that one or more results were found. For examplefound("bean", "beans").items("x", "y")
results in the message "found beans x, y".- Parameters:
singular
- the article found in singular formplural
- the article found in plural form- Returns:
- an
ConditionMessage.ItemsBuilder
didNotFind
public ConditionMessage.ItemsBuilder didNotFind(String article)
Indicate that one or more results were not found. For exampledidNotFind("bean").items("x")
results in the message "did not find bean x".- Parameters:
article
- the article found- Returns:
- an
ConditionMessage.ItemsBuilder
didNotFind
public ConditionMessage.ItemsBuilder didNotFind(String singular, String plural)
Indicate that one or more results were found. For exampledidNotFind("bean", "beans").items("x", "y")
results in the message "did not find beans x, y".- Parameters:
singular
- the article found in singular formplural
- the article found in plural form- Returns:
- an
ConditionMessage.ItemsBuilder
resultedIn
public ConditionMessage resultedIn(Object result)
Indicates a single result. For exampleresultedIn("yes")
results in the message "resulted in yes".- Parameters:
result
- the result- Returns:
- a built
ConditionMessage
available
public ConditionMessage available(String item)
Indicates something is available. For exampleavailable("money")
results in the message "money is available".- Parameters:
item
- the item that is available- Returns:
- a built
ConditionMessage
notAvailable
public ConditionMessage notAvailable(String item)
Indicates something is not available. For examplenotAvailable("time")
results in the message "time is not available".- Parameters:
item
- the item that is not available- Returns:
- a built
ConditionMessage
because
public ConditionMessage because(String reason)
Indicates the reason. For examplereason("running Linux")
results in the message "running Linux".- Parameters:
reason
- the reason for the message- Returns:
- a built
ConditionMessage