Class InvalidArgumentException

All Implemented Interfaces:
Serializable

public final class InvalidArgumentException extends AbstractInvalidArgumentException
Author:
Silvan Wyss
See Also:
  • Method Details

    • forArgument

      public static InvalidArgumentException forArgument(Object argument)
      Parameters:
      argument - - Can be null
      Returns:
      a new InvalidArgumentException for the given argument.
    • forArgumentAndErrorPredicate

      public static InvalidArgumentException forArgumentAndErrorPredicate(Object argument, String errorPredicate)
      Parameters:
      argument - - Can be null
      errorPredicate -
      Returns:
      a new InvalidArgumentException for the given argument and errorPredicate
      Throws:
      RuntimeException - if the given errorPredicate is null or blank or ends with a dot.
    • forArgumentAndArgumentName

      public static InvalidArgumentException forArgumentAndArgumentName(Object argument, String argumentName)
      Parameters:
      argument - - Can be null
      argumentName -
      Returns:
      a new InvalidArgumentException for the given argument and argumentName
      Throws:
      RuntimeException - if the given argumentName is null or blank
    • forArgumentAndArgumentNameAndErrorPredicate

      public static InvalidArgumentException forArgumentAndArgumentNameAndErrorPredicate(Object argument, String argumentName, String errorPredicate)
      Parameters:
      argument -
      argumentName -
      errorPredicate -
      Returns:
      a new InvalidArgumentException for the given argument, argumentName and errorPredicate
      Throws:
      RuntimeException - if the given argumentName is null or blank
      RuntimeException - if the given errorPredicate is null or blank or ends with a dot.
    • forArgumentAndArgumentType

      public static <A> InvalidArgumentException forArgumentAndArgumentType(A argument, Class<A> argumentType)
      Type Parameters:
      A - the type of the given argument
      Parameters:
      argument -
      argumentType -
      Returns:
      a new @link InvalidArgumentException} for the givne argument and argumentType
      Throws:
      RuntimeException - if the given arumentType is null