Class Preconditions

java.lang.Object
de.siegmar.fastcsv.util.Preconditions

public final class Preconditions extends Object
Internal utility class.

It is not a part of the API!

  • Constructor Details

    • Preconditions

      private Preconditions()
  • Method Details

    • checkArgument

      public static void checkArgument(boolean expression, String errorMessage)
      Checks the given argument and throws an exception if not met.
      Parameters:
      expression - the expression that has to be true
      errorMessage - the exception message to be thrown
      Throws:
      IllegalArgumentException - if the expression is false.
    • checkArgument

      public static void checkArgument(boolean expression, String errorMessageTemplate, Object... errorMessageArgs)
      Checks the given argument and throws an exception if not met.
      Parameters:
      expression - the expression that has to be true
      errorMessageTemplate - the exception message template (format String.format(String, Object...)) to be thrown
      errorMessageArgs - the exception message arguments
      Throws:
      IllegalArgumentException - if the expression is false.