Package io.kubernetes.client.util
Class Preconditions
java.lang.Object
io.kubernetes.client.util.Preconditions
support for different invariant checks, like for a example a non-null argument being passed to a
method that does not support nulls.
- Author:
- wind57
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
precondition
(T validate, Predicate<? super T> predicate, Supplier<String> errorSupplier)
-
Method Details
-
precondition
public static <T> T precondition(T validate, Predicate<? super T> predicate, Supplier<String> errorSupplier) - Type Parameters:
T
-- Parameters:
validate
- argument to be validatedpredicate
- to check againsterrorSupplier
- the error message generator- Returns:
- T if Predicate does not match
- Throws:
IllegalArgumentException
- if predicate returns true
-