public interface MessageComposer
An interface that defines methods to compose a message when a value violates a given condition based on a context.
| Modifier and Type | Interface and Description |
|---|---|
static class |
MessageComposer.Default
A default implementation of
MessageComposer. |
| Modifier and Type | Method and Description |
|---|---|
<T> String |
composeMessageForAssertion(T value,
Predicate<? super T> predicate)
Compose a message string for a
value, which violates a general condition given as predicate. |
<T> String |
composeMessageForPostcondition(T value,
Predicate<? super T> predicate)
Compose a message string for a
value, which violates a postcondition given as predicate. |
<T> String |
composeMessageForPrecondition(T value,
Predicate<? super T> predicate)
Compose a message string for a
value, which violates a precondition given as predicate. |
<T> String |
composeMessageForValidation(T value,
Predicate<? super T> predicate)
Compose a message string for a
value, which violates a user input checking
condition given as predicate. |
<T> String composeMessageForPrecondition(T value, Predicate<? super T> predicate)
Compose a message string for a value, which violates a precondition given as predicate.
T - The type of the value.value - A value for which a message is created.predicate - A condition that a given value violated.<T> String composeMessageForPostcondition(T value, Predicate<? super T> predicate)
Compose a message string for a value, which violates a postcondition given as predicate.
T - The type of the value.value - A value for which a message is created.predicate - A condition that a given value violated.<T> String composeMessageForAssertion(T value, Predicate<? super T> predicate)
Compose a message string for a value, which violates a general condition given as predicate.
Used for invariant conditions, test assertion (assertThat), and test prerequisition
checking (assumeThat).
T - The type of the value.value - A value for which a message is created.predicate - A condition that a given value violated.<T> String composeMessageForValidation(T value, Predicate<? super T> predicate)
Compose a message string for a value, which violates a user input checking
condition given as predicate.
T - The type of the value.value - A value for which a message is created.predicate - A condition that a given value violated.Copyright © 2025. All rights reserved.