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
public final class FinalViolationException extends ConstraintViolationException
Signals, that an attempt to write an field has been failed, because it cannot be written with any value. This exception will be thrown byItem.set
if that field isfinal
.- Author:
- Ralf Wiebicke
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FinalViolationException(Feature feature, Settable<?> settable, Item item)
Deprecated.Usecreate(Feature, Item)
instead.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static <F extends Feature & Settable<?>>
voidcheck(F feature, Item item)
static <F extends Feature & Settable<?>>
FinalViolationExceptioncreate(F feature, Item item)
Creates a new FinalViolationException with the necessary information about the violation.Feature
getFeature()
Returns the feature, that was attempted to be written.Feature
getFinalAttribute()
Deprecated.Renamed togetFeature()
.String
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 Detail
-
FinalViolationException
@Deprecated public FinalViolationException(Feature feature, Settable<?> settable, Item item)
Deprecated.Usecreate(Feature, Item)
instead.
-
-
Method Detail
-
check
public static <F extends Feature & Settable<?>> void check(@Nonnull F feature, @Nonnull Item item)
-
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
public Feature getFeature()
Returns the feature, that was attempted to be written.- Specified by:
getFeature
in classConstraintViolationException
-
getMessage
public String getMessage(boolean withFeature)
- Specified by:
getMessage
in classConstraintViolationException
-
getFinalAttribute
@Deprecated public Feature getFinalAttribute()
Deprecated.Renamed togetFeature()
.
-
-