Package com.exedio.cope
Class RangeViolationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.exedio.cope.ConstraintViolationException
com.exedio.cope.RangeViolationException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
DoubleRangeViolationException
,IntegerRangeViolationException
,LongRangeViolationException
Signals, that an attempt to write an
FunctionField
has been failed,
because the value to be written violated the range constraint on that field.
This exception will be thrown by FunctionField.set(Item,Object)
and item constructors.- Author:
- Ralf Wiebicke
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
RangeViolationException
(FunctionField<? extends Number> feature, Item item, Number value, boolean isTooSmall, Number border) Creates a new RangeViolationException with the necessary information about the violation. -
Method Summary
Modifier and TypeMethodDescriptionFunctionField<? extends Number>
Returns the field, that was attempted to be written.final String
getMessage
(boolean withFeature) final boolean
Methods inherited from class com.exedio.cope.ConstraintViolationException
getItem, getItemID, getItemPhrase, getItemText, getMessage, getMessageWithoutFeature
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
RangeViolationException
protected RangeViolationException(FunctionField<? extends Number> feature, Item item, Number value, boolean isTooSmall, Number border) Creates a new RangeViolationException with the necessary information about the violation.- Parameters:
item
- initializes, what is returned byConstraintViolationException.getItem()
.feature
- initializes, what is returned bygetFeature()
.
-
-
Method Details
-
getFeature
Returns the field, that was attempted to be written.- Specified by:
getFeature
in classConstraintViolationException
-
isTooSmall
public final boolean isTooSmall() -
getMessage
- Specified by:
getMessage
in classConstraintViolationException
-