|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2020 the original author or authors. |
| 2 | + * Copyright 2002-2022 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.
|
@@ -101,9 +101,10 @@ public static void state(boolean expression, Supplier<String> messageSupplier) {
|
101 | 101 | /**
|
102 | 102 | * Assert a boolean expression, throwing an {@code IllegalStateException}
|
103 | 103 | * if the expression evaluates to {@code false}.
|
104 |
| - * @deprecated as of 4.3.7, in favor of {@link #state(boolean, String)} |
| 104 | + * @deprecated as of 4.3.7, in favor of {@link #state(boolean, String)}; |
| 105 | + * to be removed in 6.1 |
105 | 106 | */
|
106 |
| - @Deprecated |
| 107 | + @Deprecated(forRemoval = true) |
107 | 108 | public static void state(boolean expression) {
|
108 | 109 | state(expression, "[Assertion failed] - this state invariant must be true");
|
109 | 110 | }
|
@@ -143,9 +144,10 @@ public static void isTrue(boolean expression, Supplier<String> messageSupplier)
|
143 | 144 | /**
|
144 | 145 | * Assert a boolean expression, throwing an {@code IllegalArgumentException}
|
145 | 146 | * if the expression evaluates to {@code false}.
|
146 |
| - * @deprecated as of 4.3.7, in favor of {@link #isTrue(boolean, String)} |
| 147 | + * @deprecated as of 4.3.7, in favor of {@link #isTrue(boolean, String)}; |
| 148 | + * to be removed in 6.1 |
147 | 149 | */
|
148 |
| - @Deprecated |
| 150 | + @Deprecated(forRemoval = true) |
149 | 151 | public static void isTrue(boolean expression) {
|
150 | 152 | isTrue(expression, "[Assertion failed] - this expression must be true");
|
151 | 153 | }
|
@@ -182,9 +184,10 @@ public static void isNull(@Nullable Object object, Supplier<String> messageSuppl
|
182 | 184 |
|
183 | 185 | /**
|
184 | 186 | * Assert that an object is {@code null}.
|
185 |
| - * @deprecated as of 4.3.7, in favor of {@link #isNull(Object, String)} |
| 187 | + * @deprecated as of 4.3.7, in favor of {@link #isNull(Object, String)}; |
| 188 | + * to be removed in 6.1 |
186 | 189 | */
|
187 |
| - @Deprecated |
| 190 | + @Deprecated(forRemoval = true) |
188 | 191 | public static void isNull(@Nullable Object object) {
|
189 | 192 | isNull(object, "[Assertion failed] - the object argument must be null");
|
190 | 193 | }
|
@@ -222,9 +225,10 @@ public static void notNull(@Nullable Object object, Supplier<String> messageSupp
|
222 | 225 |
|
223 | 226 | /**
|
224 | 227 | * Assert that an object is not {@code null}.
|
225 |
| - * @deprecated as of 4.3.7, in favor of {@link #notNull(Object, String)} |
| 228 | + * @deprecated as of 4.3.7, in favor of {@link #notNull(Object, String)}; |
| 229 | + * to be removed in 6.1 |
226 | 230 | */
|
227 |
| - @Deprecated |
| 231 | + @Deprecated(forRemoval = true) |
228 | 232 | public static void notNull(@Nullable Object object) {
|
229 | 233 | notNull(object, "[Assertion failed] - this argument is required; it must not be null");
|
230 | 234 | }
|
@@ -267,9 +271,10 @@ public static void hasLength(@Nullable String text, Supplier<String> messageSupp
|
267 | 271 | /**
|
268 | 272 | * Assert that the given String is not empty; that is,
|
269 | 273 | * it must not be {@code null} and not the empty String.
|
270 |
| - * @deprecated as of 4.3.7, in favor of {@link #hasLength(String, String)} |
| 274 | + * @deprecated as of 4.3.7, in favor of {@link #hasLength(String, String)}; |
| 275 | + * to be removed in 6.1 |
271 | 276 | */
|
272 |
| - @Deprecated |
| 277 | + @Deprecated(forRemoval = true) |
273 | 278 | public static void hasLength(@Nullable String text) {
|
274 | 279 | hasLength(text,
|
275 | 280 | "[Assertion failed] - this String argument must have length; it must not be null or empty");
|
@@ -313,9 +318,10 @@ public static void hasText(@Nullable String text, Supplier<String> messageSuppli
|
313 | 318 | /**
|
314 | 319 | * Assert that the given String contains valid text content; that is, it must not
|
315 | 320 | * be {@code null} and must contain at least one non-whitespace character.
|
316 |
| - * @deprecated as of 4.3.7, in favor of {@link #hasText(String, String)} |
| 321 | + * @deprecated as of 4.3.7, in favor of {@link #hasText(String, String)}; |
| 322 | + * to be removed in 6.1 |
317 | 323 | */
|
318 |
| - @Deprecated |
| 324 | + @Deprecated(forRemoval = true) |
319 | 325 | public static void hasText(@Nullable String text) {
|
320 | 326 | hasText(text,
|
321 | 327 | "[Assertion failed] - this String argument must have text; it must not be null, empty, or blank");
|
@@ -357,9 +363,10 @@ public static void doesNotContain(@Nullable String textToSearch, String substrin
|
357 | 363 |
|
358 | 364 | /**
|
359 | 365 | * Assert that the given text does not contain the given substring.
|
360 |
| - * @deprecated as of 4.3.7, in favor of {@link #doesNotContain(String, String, String)} |
| 366 | + * @deprecated as of 4.3.7, in favor of {@link #doesNotContain(String, String, String)}; |
| 367 | + * to be removed in 6.1 |
361 | 368 | */
|
362 |
| - @Deprecated |
| 369 | + @Deprecated(forRemoval = true) |
363 | 370 | public static void doesNotContain(@Nullable String textToSearch, String substring) {
|
364 | 371 | doesNotContain(textToSearch, substring,
|
365 | 372 | () -> "[Assertion failed] - this String argument must not contain the substring [" + substring + "]");
|
@@ -400,9 +407,10 @@ public static void notEmpty(@Nullable Object[] array, Supplier<String> messageSu
|
400 | 407 | /**
|
401 | 408 | * Assert that an array contains elements; that is, it must not be
|
402 | 409 | * {@code null} and must contain at least one element.
|
403 |
| - * @deprecated as of 4.3.7, in favor of {@link #notEmpty(Object[], String)} |
| 410 | + * @deprecated as of 4.3.7, in favor of {@link #notEmpty(Object[], String)}; |
| 411 | + * to be removed in 6.1 |
404 | 412 | */
|
405 |
| - @Deprecated |
| 413 | + @Deprecated(forRemoval = true) |
406 | 414 | public static void notEmpty(@Nullable Object[] array) {
|
407 | 415 | notEmpty(array, "[Assertion failed] - this array must not be empty: it must contain at least 1 element");
|
408 | 416 | }
|
@@ -449,9 +457,10 @@ public static void noNullElements(@Nullable Object[] array, Supplier<String> mes
|
449 | 457 |
|
450 | 458 | /**
|
451 | 459 | * Assert that an array contains no {@code null} elements.
|
452 |
| - * @deprecated as of 4.3.7, in favor of {@link #noNullElements(Object[], String)} |
| 460 | + * @deprecated as of 4.3.7, in favor of {@link #noNullElements(Object[], String)}; |
| 461 | + * to be removed in 6.1 |
453 | 462 | */
|
454 |
| - @Deprecated |
| 463 | + @Deprecated(forRemoval = true) |
455 | 464 | public static void noNullElements(@Nullable Object[] array) {
|
456 | 465 | noNullElements(array, "[Assertion failed] - this array must not contain any null elements");
|
457 | 466 | }
|
@@ -493,9 +502,10 @@ public static void notEmpty(@Nullable Collection<?> collection, Supplier<String>
|
493 | 502 | /**
|
494 | 503 | * Assert that a collection contains elements; that is, it must not be
|
495 | 504 | * {@code null} and must contain at least one element.
|
496 |
| - * @deprecated as of 4.3.7, in favor of {@link #notEmpty(Collection, String)} |
| 505 | + * @deprecated as of 4.3.7, in favor of {@link #notEmpty(Collection, String)}; |
| 506 | + * to be removed in 6.1 |
497 | 507 | */
|
498 |
| - @Deprecated |
| 508 | + @Deprecated(forRemoval = true) |
499 | 509 | public static void notEmpty(@Nullable Collection<?> collection) {
|
500 | 510 | notEmpty(collection,
|
501 | 511 | "[Assertion failed] - this collection must not be empty: it must contain at least 1 element");
|
@@ -577,9 +587,10 @@ public static void notEmpty(@Nullable Map<?, ?> map, Supplier<String> messageSup
|
577 | 587 | /**
|
578 | 588 | * Assert that a Map contains entries; that is, it must not be {@code null}
|
579 | 589 | * and must contain at least one entry.
|
580 |
| - * @deprecated as of 4.3.7, in favor of {@link #notEmpty(Map, String)} |
| 590 | + * @deprecated as of 4.3.7, in favor of {@link #notEmpty(Map, String)}; |
| 591 | + * to be removed in 6.1 |
581 | 592 | */
|
582 |
| - @Deprecated |
| 593 | + @Deprecated(forRemoval = true) |
583 | 594 | public static void notEmpty(@Nullable Map<?, ?> map) {
|
584 | 595 | notEmpty(map, "[Assertion failed] - this map must not be empty; it must contain at least one entry");
|
585 | 596 | }
|
|
0 commit comments