public abstract class BuilderUtils extends Object
Modifier and Type | Method and Description |
---|---|
static void |
assertNonEmpty(String string,
String exceptionMessage)
Assert that the given
string is not null and does not equal an empty String. |
static <T> void |
assertNonNull(T value,
String exceptionMessage)
Assert that the given
value is non null. |
static void |
assertPositive(int i,
String exceptionMessage)
Assert that the given
value is positive, meaning greater than, or equal to, zero. |
static void |
assertPositive(long l,
String exceptionMessage)
Assert that the given
value is positive, meaning greater than, or equal to, zero. |
static void |
assertStrictPositive(int i,
String exceptionMessage)
Assert that the given
value is strictly positive, meaning greater than zero. |
static void |
assertStrictPositive(long l,
String exceptionMessage)
Assert that the given
value is strictly positive, meaning greater than zero. |
static <T> void |
assertThat(T value,
Predicate<T> assertion,
String exceptionMessage)
|
public static <T> void assertThat(T value, Predicate<T> assertion, String exceptionMessage) throws AxonConfigurationException
value
will result to true
through the assertion
Predicate
.
If not, an AxonConfigurationException
is thrown containing the provided exceptionMessage
.T
- a generic specifying the type of the value
, which is the input for the assertion
value
- a T
specifying the value to assertassertion
- a Predicate
to test value
againstexceptionMessage
- The message for the exception.AxonConfigurationException
- if the value
asserts to false
by the assertion
public static <T> void assertNonNull(T value, String exceptionMessage) throws AxonConfigurationException
value
is non null. If not, an AxonConfigurationException
is thrown
containing the provided exceptionMessage
.T
- a generic specifying the type of the value
, which is the input for the assertion
value
- a T
specifying the value to assertexceptionMessage
- The message for the exception.AxonConfigurationException
- if the value
equals null
public static void assertPositive(int i, String exceptionMessage)
value
is positive, meaning greater than, or equal to, zero. If not, an AxonConfigurationException
is thrown containing the provided {code exceptionMessage}.i
- the value to assertexceptionMessage
- the message for the exceptionpublic static void assertPositive(long l, String exceptionMessage)
value
is positive, meaning greater than, or equal to, zero. If not, an AxonConfigurationException
is thrown containing the provided {code exceptionMessage}.l
- the value to assertexceptionMessage
- the message for the exceptionpublic static void assertStrictPositive(int i, String exceptionMessage)
value
is strictly positive, meaning greater than zero. If not, an AxonConfigurationException
is thrown containing the provided {code exceptionMessage}.i
- the value to assertexceptionMessage
- the message for the exception.public static void assertStrictPositive(long l, String exceptionMessage)
value
is strictly positive, meaning greater than zero. If not, an AxonConfigurationException
is thrown containing the provided {code exceptionMessage}.l
- the value to assertexceptionMessage
- the message for the exception.public static void assertNonEmpty(String string, String exceptionMessage)
string
is not null and does not equal an empty String. If not, an AxonConfigurationException
is thrown containing the provided exceptionMessage
.string
- the value to assertexceptionMessage
- the message for the exception.Copyright © 2010–2020. All rights reserved.