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 type
message - The error message
originLocation - 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 -1 if unknown
snippet - A best-effort snippet showing the invalid definition (if available)
snippetLanguage - The snippet language (for example properties, 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.
  • Constructor Details

    • ConfigurationError

      public ConfigurationError(String property, String message, @Nullable String originLocation, @Nullable String rawPropertyName, @Nullable Object rawValue)
      Constructs a configuration error with type ConfigurationError.Type.ERROR.
      Parameters:
      property - The full configuration property name
      message - The error message
      originLocation - 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 type ConfigurationError.Type.ERROR and origin information.
      Parameters:
      property - The full configuration property name
      message - The error message
      originLocation - 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 -1 if unknown
      snippet - 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 a ConfigurationError record class.
      Parameters:
      property - the value for the property record component
      type - the value for the type record component
      message - the value for the message record component
      originLocation - the value for the originLocation record component
      rawPropertyName - the value for the rawPropertyName record component
      rawValue - the value for the rawValue record component
      lineNumber - the value for the lineNumber record component
      snippet - the value for the snippet record component
      snippetLanguage - the value for the snippetLanguage record component
  • Method Details

    • withType

      Parameters:
      type - The new type
      Returns:
      A copy of this error with the given type
    • builder

      public static ConfigurationError.Builder builder(String property, String message)
      Create a builder for a ConfigurationError.

      The returned builder defaults ConfigurationError.Type to ConfigurationError.Type.ERROR.

      Parameters:
      property - The full configuration property name
      message - The error message
      Returns:
      A builder
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • property

      public String property()
      Returns the value of the property record component.
      Returns:
      the value of the property record component
    • type

      public ConfigurationError.Type type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • message

      public String message()
      Returns the value of the message record component.
      Returns:
      the value of the message record component
    • originLocation

      public @Nullable String originLocation()
      Returns the value of the originLocation record component.
      Returns:
      the value of the originLocation record component
    • rawPropertyName

      public @Nullable String rawPropertyName()
      Returns the value of the rawPropertyName record component.
      Returns:
      the value of the rawPropertyName record component
    • rawValue

      public @Nullable Object rawValue()
      Returns the value of the rawValue record component.
      Returns:
      the value of the rawValue record component
    • lineNumber

      public int lineNumber()
      Returns the value of the lineNumber record component.
      Returns:
      the value of the lineNumber record component
    • snippet

      public @Nullable String snippet()
      Returns the value of the snippet record component.
      Returns:
      the value of the snippet record component
    • snippetLanguage

      public @Nullable String snippetLanguage()
      Returns the value of the snippetLanguage record component.
      Returns:
      the value of the snippetLanguage record component