Package com.darkcollective.relix.symbol
Record Class SymbolError
java.lang.Object
java.lang.Record
com.darkcollective.relix.symbol.SymbolError
- Record Components:
kind- the error classificationnamespace- the namespace in which the conflict occurredsymbolName- the name (declared form) of the symbol being registeredmessage- a human-readable description of the problem
public record SymbolError(SymbolError.Kind kind, String namespace, String symbolName, String message)
extends Record
A non-fatal diagnostic produced during symbol registration.
Errors are collected rather than thrown so that all conflicts in a
registration batch can be reported at once. Callers inspect
RegistrationResult.errors() and decide how to surface them.
Two kinds exist:
SymbolError.Kind.SHADOW_FORBIDDEN— registration was rejected because the existing symbol'sShadowPolicyisShadowPolicy.FORBIDDEN. The table is unchanged.SymbolError.Kind.SHADOW_WARNING— registration succeeded but the new symbol replaced an existing one whose policy isShadowPolicy.WARN_AND_PERMIT. The table now holds the new symbol.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumClassification of symbol registration errors. -
Constructor Summary
ConstructorsConstructorDescriptionSymbolError(SymbolError.Kind kind, String namespace, String symbolName, String message) Creates an instance of aSymbolErrorrecord class. -
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.kind()Returns the value of thekindrecord component.message()Returns the value of themessagerecord component.Returns the value of thenamespacerecord component.Returns the value of thesymbolNamerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SymbolError
Creates an instance of aSymbolErrorrecord class.- Parameters:
kind- the value for thekindrecord componentnamespace- the value for thenamespacerecord componentsymbolName- the value for thesymbolNamerecord 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). -
kind
Returns the value of thekindrecord component.- Returns:
- the value of the
kindrecord component
-
namespace
Returns the value of thenamespacerecord component.- Returns:
- the value of the
namespacerecord component
-
symbolName
Returns the value of thesymbolNamerecord component.- Returns:
- the value of the
symbolNamerecord component
-
message
Returns the value of themessagerecord component.- Returns:
- the value of the
messagerecord component
-