Package com.exedio.cope
Class FinalViolationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.exedio.cope.ConstraintViolationException
com.exedio.cope.FinalViolationException
- All Implemented Interfaces:
Serializable
Signals, that an attempt to write an field has been failed,
because it cannot be written with any value.
This exception will be thrown by
Item.set
if that field is final
.- Author:
- Ralf Wiebicke
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionFinalViolationException
(Feature feature, Settable<?> settable, Item item) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionstatic <F extends Feature & Settable<?>>
FinalViolationExceptionCreates a new FinalViolationException with the necessary information about the violation.Returns the feature, that was attempted to be written.Deprecated.Renamed togetFeature()
.getMessage
(boolean withFeature) 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
-
FinalViolationException
Deprecated.Usecreate(Feature, Item)
instead.
-
-
Method Details
-
check
-
create
public static <F extends Feature & Settable<?>> FinalViolationException create(F feature, Item item) Creates a new FinalViolationException with the necessary information about the violation.- Parameters:
item
- initializes, what is returned byConstraintViolationException.getItem()
.feature
- initializes, what is returned bygetFeature()
.
-
getFeature
Returns the feature, that was attempted to be written.- Specified by:
getFeature
in classConstraintViolationException
-
getMessage
- Specified by:
getMessage
in classConstraintViolationException
-
getFinalAttribute
Deprecated.Renamed togetFeature()
.
-
create(Feature, Item)
instead.