Class RedisAssertions
java.lang.Object
org.springframework.data.redis.util.RedisAssertions
Abstract utility class for common assertions used in Spring Data Redis.
- Since:
- 3.1.0
- Author:
- John Blum
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
requireObject
(T target, String message, Object... arguments) Asserts the givenObject
is not null.static <T> T
requireObject
(T target, Supplier<String> message) Asserts the givenObject
is not null.
-
Constructor Details
-
RedisAssertions
public RedisAssertions()
-
-
Method Details
-
requireObject
Asserts the givenObject
is not null.- Type Parameters:
T
-type
ofObject
being asserted.- Parameters:
target
-Object
to evaluate.message
-String
containing the message for the thrown exception.arguments
- array ofObject
arguments used to format themessage
.- Returns:
- the given
Object
. - Throws:
IllegalArgumentException
- if thetarget
is null.- See Also:
-
requireObject
Asserts the givenObject
is not null.
-