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
public abstract class RangeViolationException extends ConstraintViolationException
Signals, that an attempt to write anFunctionField
has been failed, because the value to be written violated the range constraint on that field. This exception will be thrown byFunctionField.set(Item,Object)
and item constructors.- Author:
- Ralf Wiebicke
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FunctionField<? extends Number>
getFeature()
Returns the field, that was attempted to be written.String
getMessage(boolean withFeature)
boolean
isTooSmall()
-
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 Detail
-
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 Detail
-
getFeature
public FunctionField<? extends Number> getFeature()
Returns the field, that was attempted to be written.- Specified by:
getFeature
in classConstraintViolationException
-
isTooSmall
public final boolean isTooSmall()
-
getMessage
public final String getMessage(boolean withFeature)
- Specified by:
getMessage
in classConstraintViolationException
-
-