Record Class ConfigurationError
java.lang.Object
java.lang.Record
io.micronaut.jsonschema.configuration.validator.ConfigurationError
- Record Components:
property- The full configuration property name (e.g.micronaut.server.ssl.enabled)type- The error typemessage- The error messageoriginLocation- Where the property originated from (if available)rawPropertyName- The raw property name prior to normalization (if available)rawValue- The raw value (if available)lineNumber- The 1-based line number in the origin file, or-1if unknownsnippet- A best-effort snippet showing the invalid definition (if available)snippetLanguage- The snippet language (for exampleproperties,yaml,toml)
@Introspected
public record ConfigurationError(String property, ConfigurationError.Type type, String message, @Nullable String originLocation, @Nullable String rawPropertyName, @Nullable Object rawValue, int lineNumber, @Nullable String snippet, @Nullable String snippetLanguage)
extends Record
A configuration validation error.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder forConfigurationError.static enumThe configuration validation error type. -
Constructor Summary
ConstructorsConstructorDescriptionConfigurationError(String property, ConfigurationError.Type type, String message, @Nullable String originLocation, @Nullable String rawPropertyName, @Nullable Object rawValue, int lineNumber, @Nullable String snippet, @Nullable String snippetLanguage) Creates an instance of aConfigurationErrorrecord class.ConfigurationError(String property, String message, @Nullable String originLocation, @Nullable String rawPropertyName, @Nullable Object rawValue) Constructs a configuration error with typeConfigurationError.Type.ERROR.ConfigurationError(String property, String message, @Nullable String originLocation, @Nullable String rawPropertyName, @Nullable Object rawValue, int lineNumber, @Nullable String snippet, @Nullable String snippetLanguage) Constructs a configuration error with typeConfigurationError.Type.ERRORand origin information. -
Method Summary
Modifier and TypeMethodDescriptionstatic ConfigurationError.BuilderCreate a builder for aConfigurationError.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of thelineNumberrecord component.message()Returns the value of themessagerecord component.@Nullable StringReturns the value of theoriginLocationrecord component.property()Returns the value of thepropertyrecord component.@Nullable StringReturns the value of therawPropertyNamerecord component.@Nullable ObjectrawValue()Returns the value of therawValuerecord component.@Nullable Stringsnippet()Returns the value of thesnippetrecord component.@Nullable StringReturns the value of thesnippetLanguagerecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
ConfigurationError
public ConfigurationError(String property, String message, @Nullable String originLocation, @Nullable String rawPropertyName, @Nullable Object rawValue) Constructs a configuration error with typeConfigurationError.Type.ERROR.- Parameters:
property- The full configuration property namemessage- The error messageoriginLocation- Where the property originated from (if available)rawPropertyName- The raw property name prior to normalization (if available)rawValue- The raw value (if available)
-
ConfigurationError
public ConfigurationError(String property, String message, @Nullable String originLocation, @Nullable String rawPropertyName, @Nullable Object rawValue, int lineNumber, @Nullable String snippet, @Nullable String snippetLanguage) Constructs a configuration error with typeConfigurationError.Type.ERRORand origin information.- Parameters:
property- The full configuration property namemessage- The error messageoriginLocation- Where the property originated from (if available)rawPropertyName- The raw property name prior to normalization (if available)rawValue- The raw value (if available)lineNumber- The 1-based line number in the origin file, or-1if unknownsnippet- A best-effort snippet showing the invalid definition (if available)snippetLanguage- The snippet language
-
ConfigurationError
public ConfigurationError(String property, ConfigurationError.Type type, String message, @Nullable String originLocation, @Nullable String rawPropertyName, @Nullable Object rawValue, int lineNumber, @Nullable String snippet, @Nullable String snippetLanguage) Creates an instance of aConfigurationErrorrecord class.- Parameters:
property- the value for thepropertyrecord componenttype- the value for thetyperecord componentmessage- the value for themessagerecord componentoriginLocation- the value for theoriginLocationrecord componentrawPropertyName- the value for therawPropertyNamerecord componentrawValue- the value for therawValuerecord componentlineNumber- the value for thelineNumberrecord componentsnippet- the value for thesnippetrecord componentsnippetLanguage- the value for thesnippetLanguagerecord component
-
-
Method Details
-
withType
- Parameters:
type- The new type- Returns:
- A copy of this error with the given type
-
builder
Create a builder for aConfigurationError.The returned builder defaults
ConfigurationError.TypetoConfigurationError.Type.ERROR.- Parameters:
property- The full configuration property namemessage- The error message- Returns:
- A builder
-
toString
-
hashCode
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
property
-
type
-
message
-
originLocation
Returns the value of theoriginLocationrecord component.- Returns:
- the value of the
originLocationrecord component
-
rawPropertyName
Returns the value of therawPropertyNamerecord component.- Returns:
- the value of the
rawPropertyNamerecord component
-
rawValue
-
lineNumber
public int lineNumber()Returns the value of thelineNumberrecord component.- Returns:
- the value of the
lineNumberrecord component
-
snippet
-
snippetLanguage
Returns the value of thesnippetLanguagerecord component.- Returns:
- the value of the
snippetLanguagerecord component
-