Interface DataError
- All Known Implementing Classes:
DataError.Custom, DataError.DuplicateKey, DataError.IndexOutOfBounds, DataError.InvalidFormat, DataError.MissingField, DataError.NullValue, DataError.OutOfBounds, DataError.PathAware, DataError.TypeMismatch, DataError.UnknownEnum, DataError.UnsupportedOperation
public interface DataError
Defines a structured error encountered during serialization or deserialization processes.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordRepresents a generic or untyped error state.static final recordRepresents a structural collision where a key is parsed twice.static final recordRepresents an invalid index queried against an array or list.static final recordRepresents a string formatting constraint violation.static final recordRepresents an error where a mandatory structural field is absent.static final recordRepresents an unexpected null value encountered where a strict type was required.static final recordRepresents a numerical state violating explicit threshold boundaries.static final recordWraps an existing DataError to append contextual path resolution tracking.static final recordRepresents an error where a parsed type conflicts with the expected schema format.static final recordRepresents a string matching failure mapped to an Enum definition.static final recordRepresents an invocation against an unmapped or unavailable operational state. -
Method Summary
Modifier and TypeMethodDescriptionstatic DataErrorInstantiates a generic error.static DataErrorduplicateKey(String key) Instantiates a collision duplicate error.static DataErrorindexOutOfBounds(int index, int size) Instantiates a boundary mapping error.static DataErrorinvalidFormat(String value, String pattern) Instantiates a formatting constraint error.message()static DataErrormissingField(String field) Instantiates a missing field constraint error.static DataErrorInstantiates a null state error.static DataErroroutOfBounds(Number value, Number min, Number max) Instantiates a mathematical threshold error.static DataErrortypeMismatch(String expected, String actual) Instantiates a type mismatch error.static DataErrorunknownEnum(String value, String enumClass) Instantiates an enum constant error.static DataErrorunsupportedOperation(String operation) Instantiates a restricted operation error.
-
Method Details
-
message
String message()- Returns:
- The formatted message describing the context of the failure.
-
custom
-
typeMismatch
-
missingField
-
outOfBounds
-
unknownEnum
-
nullValue
-
invalidFormat
-
indexOutOfBounds
Instantiates a boundary mapping error.- Parameters:
index- Targeted query index.size- Structural upper bound.- Returns:
- A constructed DataError.
-
duplicateKey
-
unsupportedOperation
-