java.lang.Object
java.lang.Record
de.bsommerfeld.jshepherd.core.LoadIssue
- Record Components:
key- the configuration key that failed to applyrawValue- the raw value found in the file (may be null)targetType- the Java type of the field the value was meant formessage- a human-readable description of what went wrong
public record LoadIssue(String key, Object rawValue, Class<?> targetType, String message)
extends Record
Describes a single value that could not be applied during a load or reload —
for example a string that does not parse into a numeric field, or an unknown
enum constant.
When such an issue occurs, the affected field keeps its current (default)
value, a warning is logged, and the issue is recorded on the configuration
POJO. Retrieve the issues via ConfigurablePojo.getLastLoadIssues() —
typically inside a @PostInject method to fail fast:
@PostInject
private void validate() {
if (!getLastLoadIssues().isEmpty()) {
throw new IllegalStateException("Invalid config: " + getLastLoadIssues());
}
}
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.key()Returns the value of thekeyrecord component.message()Returns the value of themessagerecord component.rawValue()Returns the value of therawValuerecord component.Class<?> Returns the value of thetargetTyperecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
LoadIssue
Creates an instance of aLoadIssuerecord class.- Parameters:
key- the value for thekeyrecord componentrawValue- the value for therawValuerecord componenttargetType- the value for thetargetTyperecord componentmessage- the value for themessagerecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
key
Returns the value of thekeyrecord component.- Returns:
- the value of the
keyrecord component
-
rawValue
Returns the value of therawValuerecord component.- Returns:
- the value of the
rawValuerecord component
-
targetType
Returns the value of thetargetTyperecord component.- Returns:
- the value of the
targetTyperecord component
-
message
Returns the value of themessagerecord component.- Returns:
- the value of the
messagerecord component
-