Class ArgumentDoesNotHaveAttributeException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
ch.nolix.baseapi.errorcontrol.invalidargumentexception.AbstractInvalidArgumentException
ch.nolix.baseapi.errorcontrol.invalidargumentexception.ArgumentDoesNotHaveAttributeException
- All Implemented Interfaces:
Serializable
A
ArgumentDoesNotHaveAttributeException is a
AbstractInvalidArgumentException that is supposed to be thrown when a
given argument does undesirably not have a given attribute.- Author:
- Silvan Wyss
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionforArgumentAndArgumentNameAndAttributeName(Object argument, String argumentName, String attributeName) forArgumentAndArgumentNameAndAttributeType(String argumentName, Object argument, Class<?> attributeType) forArgumentAndAttributeName(Object argument, String attributeName) forArgumentAndAttributeType(Object argument, Class<?> attributeType) 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
-
forArgumentAndAttributeName
public static ArgumentDoesNotHaveAttributeException forArgumentAndAttributeName(Object argument, String attributeName) - Parameters:
argument- - Can be null.attributeName-- Returns:
- a new
ArgumentDoesNotHaveAttributeExceptionfor the given argument and attributeName. - Throws:
RuntimeException- if the given attributeName is null or blank.
-
forArgumentAndAttributeType
public static ArgumentDoesNotHaveAttributeException forArgumentAndAttributeType(Object argument, Class<?> attributeType) - Parameters:
argument- - Can be null.attributeType-- Returns:
- a new
ArgumentDoesNotHaveAttributeExceptionfor the given argument and attributeType. - Throws:
RuntimeException- if the given attributeType is null.
-
forArgumentAndArgumentNameAndAttributeName
public static ArgumentDoesNotHaveAttributeException forArgumentAndArgumentNameAndAttributeName(Object argument, String argumentName, String attributeName) - Parameters:
argument- - Can be null.argumentName-attributeName-- Returns:
- a new
ArgumentDoesNotHaveAttributeExceptionfor the given argument, argumentName and attributeName. - Throws:
RuntimeException- if the given argumentName is null or blank.RuntimeException- if the given attributeName is null or blank.
-
forArgumentAndArgumentNameAndAttributeType
public static ArgumentDoesNotHaveAttributeException forArgumentAndArgumentNameAndAttributeType(String argumentName, Object argument, Class<?> attributeType) - Parameters:
argumentName-argument- - Can be null.attributeType-- Returns:
- a new
ArgumentDoesNotHaveAttributeExceptionfor the given argument, argumentName and attributeType. - Throws:
RuntimeException- if the given argumentName is null or blank.RuntimeException- if the given attributeType is null.
-
toNoSuchElementException
- Returns:
- a new
NoSuchElementExceptionrepresentation of the currentArgumentDoesNotHaveAttributeException.
-