java.lang.Object
org.apache.jackrabbit.oak.commons.conditions.Validate

public final class Validate extends Object
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    checkArgument(boolean expression)
    Checks the specified expression
    static void
    checkArgument(boolean expression, @NotNull String message)
    Checks the specified expression
    static void
    checkArgument(boolean expression, @NotNull String messageTemplate, @Nullable Object... messageArgs)
    Checks the specified expression
    static void
    checkState(boolean expression)
    Checks whether the specified expression is true
    static void
    checkState(boolean expression, @NotNull Object errorMessage)
    Checks whether the specified expression is true
    static void
    checkState(boolean expression, @NotNull String messageTemplate, @Nullable Object... messageArgs)
    Checks whether the specified expression is true

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • checkArgument

      public static void checkArgument(boolean expression) throws IllegalArgumentException
      Checks the specified expression
      Parameters:
      expression - to check
      Throws:
      IllegalArgumentException - when false
    • checkArgument

      public static void checkArgument(boolean expression, @NotNull @NotNull String message) throws IllegalArgumentException
      Checks the specified expression
      Parameters:
      expression - to check
      message - to use in exception
      Throws:
      IllegalArgumentException - when false
    • checkArgument

      public static void checkArgument(boolean expression, @NotNull @NotNull String messageTemplate, @Nullable @Nullable Object... messageArgs)
      Checks the specified expression
      Parameters:
      expression - to checks
      messageTemplate - to use in exception (using String.format(java.lang.String, java.lang.Object...) syntax
      Throws:
      IllegalArgumentException - when false
    • checkState

      public static void checkState(boolean expression)
      Checks whether the specified expression is true
      Parameters:
      expression - expression to checks
      Throws:
      IllegalStateException - if expression is false
    • checkState

      public static void checkState(boolean expression, @NotNull @NotNull Object errorMessage)
      Checks whether the specified expression is true
      Parameters:
      expression - expression to checks
      errorMessage - message to use in exception
      Throws:
      IllegalStateException - if expression is false
    • checkState

      public static void checkState(boolean expression, @NotNull @NotNull String messageTemplate, @Nullable @Nullable Object... messageArgs)
      Checks whether the specified expression is true
      Parameters:
      expression - expression to checks
      messageTemplate - to use in exception (using String.format(java.lang.String, java.lang.Object...) syntax
      messageArgs - arguments to use in messageTemplate
      Throws:
      IllegalArgumentException - if expression is false