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
Instantiates a generic error.- Parameters:
msg- The target message.- Returns:
- A constructed DataError.
-
typeMismatch
Instantiates a type mismatch error.- Parameters:
expected- Target type sequence.actual- Encountered type sequence.- Returns:
- A constructed DataError.
-
missingField
Instantiates a missing field constraint error.- Parameters:
field- Target nested key.- Returns:
- A constructed DataError.
-
outOfBounds
Instantiates a mathematical threshold error.- Parameters:
value- Target node.min- Acceptable low.max- Acceptable high.- Returns:
- A constructed DataError.
-
unknownEnum
Instantiates an enum constant error.- Parameters:
value- Evaluated input.enumClass- Target Enum descriptor.- Returns:
- A constructed DataError.
-
nullValue
Instantiates a null state error.- Parameters:
expected- Expected structural wrapper.- Returns:
- A constructed DataError.
-
invalidFormat
Instantiates a formatting constraint error.- Parameters:
value- Evaluated string.pattern- Required sequence.- Returns:
- A constructed DataError.
-
indexOutOfBounds
Instantiates a boundary mapping error.- Parameters:
index- Targeted query index.size- Structural upper bound.- Returns:
- A constructed DataError.
-
duplicateKey
Instantiates a collision duplicate error.- Parameters:
key- Evaluated key.- Returns:
- A constructed DataError.
-
unsupportedOperation
Instantiates a restricted operation error.- Parameters:
operation- Evaluated action.- Returns:
- A constructed DataError.
-