Merge branch '5.2.x'
This commit is contained in:
commit
9c8a8d82b9
|
@ -83,8 +83,8 @@ public abstract class Assert {
|
||||||
* <p>Call {@link #isTrue} if you wish to throw an {@code IllegalArgumentException}
|
* <p>Call {@link #isTrue} if you wish to throw an {@code IllegalArgumentException}
|
||||||
* on an assertion failure.
|
* on an assertion failure.
|
||||||
* <pre class="code">
|
* <pre class="code">
|
||||||
* Assert.state(id == null,
|
* Assert.state(entity.getId() == null,
|
||||||
* () -> "ID for " + entity.getName() + " must not already be initialized");
|
* () -> "ID for entity " + entity.getName() + " must not already be initialized");
|
||||||
* </pre>
|
* </pre>
|
||||||
* @param expression a boolean expression
|
* @param expression a boolean expression
|
||||||
* @param messageSupplier a supplier for the exception message to use if the
|
* @param messageSupplier a supplier for the exception message to use if the
|
||||||
|
@ -205,7 +205,8 @@ public abstract class Assert {
|
||||||
/**
|
/**
|
||||||
* Assert that an object is not {@code null}.
|
* Assert that an object is not {@code null}.
|
||||||
* <pre class="code">
|
* <pre class="code">
|
||||||
* Assert.notNull(clazz, () -> "The class '" + clazz.getName() + "' must not be null");
|
* Assert.notNull(entity.getId(),
|
||||||
|
* () -> "ID for entity " + entity.getName() + " must not be null");
|
||||||
* </pre>
|
* </pre>
|
||||||
* @param object the object to check
|
* @param object the object to check
|
||||||
* @param messageSupplier a supplier for the exception message to use if the
|
* @param messageSupplier a supplier for the exception message to use if the
|
||||||
|
@ -247,7 +248,8 @@ public abstract class Assert {
|
||||||
* Assert that the given String is not empty; that is,
|
* Assert that the given String is not empty; that is,
|
||||||
* it must not be {@code null} and not the empty String.
|
* it must not be {@code null} and not the empty String.
|
||||||
* <pre class="code">
|
* <pre class="code">
|
||||||
* Assert.hasLength(name, () -> "Name for account '" + account.getId() + "' must not be empty");
|
* Assert.hasLength(account.getName(),
|
||||||
|
* () -> "Name for account '" + account.getId() + "' must not be empty");
|
||||||
* </pre>
|
* </pre>
|
||||||
* @param text the String to check
|
* @param text the String to check
|
||||||
* @param messageSupplier a supplier for the exception message to use if the
|
* @param messageSupplier a supplier for the exception message to use if the
|
||||||
|
@ -292,7 +294,8 @@ public abstract class Assert {
|
||||||
* Assert that the given String contains valid text content; that is, it must not
|
* Assert that the given String contains valid text content; that is, it must not
|
||||||
* be {@code null} and must contain at least one non-whitespace character.
|
* be {@code null} and must contain at least one non-whitespace character.
|
||||||
* <pre class="code">
|
* <pre class="code">
|
||||||
* Assert.hasText(name, () -> "Name for account '" + account.getId() + "' must not be empty");
|
* Assert.hasText(account.getName(),
|
||||||
|
* () -> "Name for account '" + account.getId() + "' must not be empty");
|
||||||
* </pre>
|
* </pre>
|
||||||
* @param text the String to check
|
* @param text the String to check
|
||||||
* @param messageSupplier a supplier for the exception message to use if the
|
* @param messageSupplier a supplier for the exception message to use if the
|
||||||
|
|
Loading…
Reference in New Issue