|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2018 the original author or authors. |
| 2 | + * Copyright 2002-2020 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
@@ -80,8 +80,8 @@ public static void state(boolean expression, String message) {
|
80 | 80 | * <p>Call {@link #isTrue} if you wish to throw an {@code IllegalArgumentException}
|
81 | 81 | * on an assertion failure.
|
82 | 82 | * <pre class="code">
|
83 |
| - * Assert.state(id == null, |
84 |
| - * () -> "ID for " + entity.getName() + " must not already be initialized"); |
| 83 | + * Assert.state(entity.getId() == null, |
| 84 | + * () -> "ID for entity " + entity.getName() + " must not already be initialized"); |
85 | 85 | * </pre>
|
86 | 86 | * @param expression a boolean expression
|
87 | 87 | * @param messageSupplier a supplier for the exception message to use if the
|
@@ -202,7 +202,8 @@ public static void notNull(@Nullable Object object, String message) {
|
202 | 202 | /**
|
203 | 203 | * Assert that an object is not {@code null}.
|
204 | 204 | * <pre class="code">
|
205 |
| - * Assert.notNull(clazz, () -> "The class '" + clazz.getName() + "' must not be null"); |
| 205 | + * Assert.notNull(entity.getId(), |
| 206 | + * () -> "ID for entity " + entity.getName() + " must not be null"); |
206 | 207 | * </pre>
|
207 | 208 | * @param object the object to check
|
208 | 209 | * @param messageSupplier a supplier for the exception message to use if the
|
@@ -244,7 +245,8 @@ public static void hasLength(@Nullable String text, String message) {
|
244 | 245 | * Assert that the given String is not empty; that is,
|
245 | 246 | * it must not be {@code null} and not the empty String.
|
246 | 247 | * <pre class="code">
|
247 |
| - * Assert.hasLength(name, () -> "Name for account '" + account.getId() + "' must not be empty"); |
| 248 | + * Assert.hasLength(account.getName(), |
| 249 | + * () -> "Name for account '" + account.getId() + "' must not be empty"); |
248 | 250 | * </pre>
|
249 | 251 | * @param text the String to check
|
250 | 252 | * @param messageSupplier a supplier for the exception message to use if the
|
@@ -289,7 +291,8 @@ public static void hasText(@Nullable String text, String message) {
|
289 | 291 | * Assert that the given String contains valid text content; that is, it must not
|
290 | 292 | * be {@code null} and must contain at least one non-whitespace character.
|
291 | 293 | * <pre class="code">
|
292 |
| - * Assert.hasText(name, () -> "Name for account '" + account.getId() + "' must not be empty"); |
| 294 | + * Assert.hasText(account.getName(), |
| 295 | + * () -> "Name for account '" + account.getId() + "' must not be empty"); |
293 | 296 | * </pre>
|
294 | 297 | * @param text the String to check
|
295 | 298 | * @param messageSupplier a supplier for the exception message to use if the
|
|
0 commit comments