Package com.exedio.cope
Class DataLengthViolationException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- com.exedio.cope.ConstraintViolationException
-
- com.exedio.cope.DataLengthViolationException
-
- All Implemented Interfaces:
Serializable
public final class DataLengthViolationException extends ConstraintViolationException
Signals, that an attempt to write adata field
has been failed, because value to be written violated the length constraint on that field. This exception will be thrown byDataField.set(Item,byte[])
etc. and item constructors.- Author:
- Ralf Wiebicke
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description DataField
getDataAttribute()
Deprecated.Renamed togetFeature()
.DataField
getFeature()
Returns the field, that was attempted to be written.long
getLength()
Returns the length of the data, that was attempted to be written.String
getMessage(boolean withFeature)
boolean
isLengthExact()
Returns, whether the value returned bygetLength()
is the exact length of the data attempted to be written (true) or just a lower bound of that length (false).-
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
-
-
-
-
Method Detail
-
getFeature
public DataField getFeature()
Returns the field, that was attempted to be written.- Specified by:
getFeature
in classConstraintViolationException
-
getLength
public long getLength()
Returns the length of the data, that was attempted to be written. Returns -1, if that length is unknown.- See Also:
isLengthExact()
-
isLengthExact
public boolean isLengthExact()
Returns, whether the value returned bygetLength()
is the exact length of the data attempted to be written (true) or just a lower bound of that length (false).
-
getMessage
public String getMessage(boolean withFeature)
- Specified by:
getMessage
in classConstraintViolationException
-
getDataAttribute
@Deprecated public DataField getDataAttribute()
Deprecated.Renamed togetFeature()
.
-
-