Class ConditionMessage
java.lang.Object
org.springframework.boot.autoconfigure.condition.ConditionMessage
A message associated with a
ConditionOutcome. Provides a fluent builder style
API to encourage consistency across all condition messages.- Since:
- 1.4.1
- Author:
- Phillip Webb
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal classBuilder used to create aConditionMessagefor a condition.final classBuilder used to create anConditionMessage.ItemsBuilderfor a condition.static enumRender styles. -
Method Summary
Modifier and TypeMethodDescriptionandCondition(Class<? extends Annotation> condition, Object... details) Return a new builder to construct a newConditionMessagebased on the instance and a new condition outcome.andCondition(String condition, Object... details) Return a new builder to construct a newConditionMessagebased on the instance and a new condition outcome.Return a newConditionMessagebased on the instance and an appended message.static ConditionMessageempty()Factory method to return a new emptyConditionMessage.booleanstatic ConditionMessage.BuilderforCondition(Class<? extends Annotation> condition, Object... details) Factory method for a builder to construct a newConditionMessagefor a condition.static ConditionMessage.BuilderforCondition(String condition, Object... details) Factory method for a builder to construct a newConditionMessagefor a condition.inthashCode()booleanisEmpty()Returntrueif the message is empty.static ConditionMessageFactory method to create a newConditionMessagewith a specific message.static ConditionMessageof(Collection<? extends ConditionMessage> messages) Factory method to create a newConditionMessagecomprised of the specified messages.toString()
-
Method Details
-
isEmpty
public boolean isEmpty()Returntrueif the message is empty.- Returns:
- if the message is empty
-
equals
-
hashCode
public int hashCode() -
toString
-
append
Return a newConditionMessagebased on the instance and an appended message.- Parameters:
message- the message to append- Returns:
- a new
ConditionMessageinstance
-
andCondition
public ConditionMessage.Builder andCondition(Class<? extends Annotation> condition, Object... details) Return a new builder to construct a newConditionMessagebased on the instance and a new condition outcome.- Parameters:
condition- the conditiondetails- details of the condition- Returns:
- a
ConditionMessage.Builderbuilder - See Also:
-
andCondition
Return a new builder to construct a newConditionMessagebased on the instance and a new condition outcome.- Parameters:
condition- the conditiondetails- details of the condition- Returns:
- a
ConditionMessage.Builderbuilder - See Also:
-
empty
Factory method to return a new emptyConditionMessage.- Returns:
- a new empty
ConditionMessage
-
of
Factory method to create a newConditionMessagewith a specific message.- Parameters:
message- the source message (may be a format string ifargsare specified)args- format arguments for the message- Returns:
- a new
ConditionMessageinstance
-
of
Factory method to create a newConditionMessagecomprised of the specified messages.- Parameters:
messages- the source messages (may benull)- Returns:
- a new
ConditionMessageinstance
-
forCondition
public static ConditionMessage.Builder forCondition(Class<? extends Annotation> condition, Object... details) Factory method for a builder to construct a newConditionMessagefor a condition.- Parameters:
condition- the conditiondetails- details of the condition- Returns:
- a
ConditionMessage.Builderbuilder - See Also:
-
forCondition
Factory method for a builder to construct a newConditionMessagefor a condition.- Parameters:
condition- the conditiondetails- details of the condition- Returns:
- a
ConditionMessage.Builderbuilder - See Also:
-