Class InvalidArgumentException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
ch.nolix.baseapi.errorcontrol.invalidargumentexception.AbstractInvalidArgumentException
ch.nolix.baseapi.errorcontrol.invalidargumentexception.InvalidArgumentException
- All Implemented Interfaces:
Serializable
- Author:
- Silvan Wyss
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic InvalidArgumentExceptionforArgument(Object argument) static InvalidArgumentExceptionforArgumentAndArgumentName(Object argument, String argumentName) static InvalidArgumentExceptionforArgumentAndArgumentNameAndErrorPredicate(Object argument, String argumentName, String errorPredicate) static InvalidArgumentExceptionforArgumentAndErrorPredicate(Object argument, String errorPredicate) Methods inherited from class AbstractInvalidArgumentException
getArgumentName, getErrorPredicate, getStoredArgumentMethods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Method Details
-
forArgument
- Parameters:
argument- - Can be null.- Returns:
- a new
InvalidArgumentExceptionfor the given argument.
-
forArgumentAndErrorPredicate
public static InvalidArgumentException forArgumentAndErrorPredicate(Object argument, String errorPredicate) - Parameters:
argument- - Can be null.errorPredicate-- Returns:
- a new
InvalidArgumentExceptionfor 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
InvalidArgumentExceptionfor 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
InvalidArgumentExceptionfor 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.
-