Class Preconditions

java.lang.Object
io.kubernetes.client.util.Preconditions

public final class Preconditions extends Object
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 Details

    • precondition

      public static <T> T precondition(T validate, Predicate<? super T> predicate, Supplier<String> errorSupplier)
      Type Parameters:
      T -
      Parameters:
      validate - argument to be validated
      predicate - to check against
      errorSupplier - the error message generator
      Returns:
      T if Predicate does not match
      Throws:
      IllegalArgumentException - if predicate returns true