类 ConditionMessage
- java.lang.Object
- org.springframework.boot.autoconfigure.condition.ConditionMessage
public final class ConditionMessage extends Object
A message associated with aConditionOutcome. Provides a fluent builder style API to encourage consistency across all condition messages.- 从以下版本开始:
- 1.4.1
嵌套类概要
嵌套类 修饰符和类型 类 说明 classConditionMessage.BuilderBuilder used to create aConditionMessagefor a condition.classConditionMessage.ItemsBuilderBuilder used to create aConditionMessage.ItemsBuilderfor a condition.static classConditionMessage.StyleRender styles.
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 ConditionMessage.BuilderandCondition(Class<? extends Annotation> condition, Object... details)Return a new builder to construct a newConditionMessagebased on the instance and a new condition outcome.ConditionMessage.BuilderandCondition(String condition, Object... details)Return a new builder to construct a newConditionMessagebased on the instance and a new condition outcome.ConditionMessageappend(String message)Return a newConditionMessagebased on the instance and an appended message.static ConditionMessageempty()Factory method to return a new emptyConditionMessage.booleanequals(Object obj)static 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 ConditionMessageof(String message, Object... args)Factory method to create a newConditionMessagewith a specific message.static ConditionMessageof(Collection<? extends ConditionMessage> messages)Factory method to create a newConditionMessagecomprised of the specified messages.StringtoString()
方法详细资料
isEmpty
public boolean isEmpty()
Returntrueif the message is empty.- 返回:
- if the message is empty
append
public ConditionMessage append(String message)
Return a newConditionMessagebased on the instance and an appended message.- 参数:
message- the message to append- 返回:
- 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.- 参数:
condition- the conditiondetails- details of the condition- 返回:
- a
ConditionMessage.Builderbuilder - 另请参阅:
andCondition(String, Object...),forCondition(Class, Object...)
andCondition
public ConditionMessage.Builder andCondition(String condition, Object... details)
Return a new builder to construct a newConditionMessagebased on the instance and a new condition outcome.- 参数:
condition- the conditiondetails- details of the condition- 返回:
- a
ConditionMessage.Builderbuilder - 另请参阅:
andCondition(Class, Object...),forCondition(String, Object...)
empty
public static ConditionMessage empty()
Factory method to return a new emptyConditionMessage.- 返回:
- a new empty
ConditionMessage
of
public static ConditionMessage of(String message, Object... args)
Factory method to create a newConditionMessagewith a specific message.- 参数:
message- the source message (may be a format string ifargsare specified)args- format arguments for the message- 返回:
- a new
ConditionMessageinstance
of
public static ConditionMessage of(Collection<? extends ConditionMessage> messages)
Factory method to create a newConditionMessagecomprised of the specified messages.- 参数:
messages- the source messages (may benull)- 返回:
- 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.- 参数:
condition- the conditiondetails- details of the condition- 返回:
- a
ConditionMessage.Builderbuilder - 另请参阅:
forCondition(String, Object...),andCondition(String, Object...)
forCondition
public static ConditionMessage.Builder forCondition(String condition, Object... details)
Factory method for a builder to construct a newConditionMessagefor a condition.- 参数:
condition- the conditiondetails- details of the condition- 返回:
- a
ConditionMessage.Builderbuilder - 另请参阅:
forCondition(Class, Object...),andCondition(String, Object...)