Record Class UnknownKeyOptions

java.lang.Object
java.lang.Record
com.patbaumgartner.spring.migrator.core.UnknownKeyOptions
Record Components:
policy - whether to look for unrecognised keys, and whether they fail the build
includes - namespaces to inspect instead of the built-in defaults, which is how a project opts a namespace of its own into the check
excludes - exact keys or prefixes to never report, which is the escape hatch for keys read directly by application code or by a library that publishes no metadata

public record UnknownKeyOptions(UnknownKeyPolicy policy, List<String> includes, List<String> excludes) extends Record
How a run should treat configuration keys that no metadata describes.
  • Constructor Details

    • UnknownKeyOptions

      public UnknownKeyOptions(UnknownKeyPolicy policy, List<String> includes, List<String> excludes)
      Defensively copies the lists and accepts null for either, so that a build tool that leaves an unset list parameter alone behaves like one that sets it empty.
      Parameters:
      policy - whether to look for unrecognised keys
      includes - namespaces to inspect instead of the built-in defaults
      excludes - exact keys or prefixes to never report
  • Method Details

    • disabled

      public static UnknownKeyOptions disabled()
      Returns options that switch the check off, which is the default.
      Returns:
      disabled options
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • policy

      public UnknownKeyPolicy policy()
      Returns the value of the policy record component.
      Returns:
      the value of the policy record component
    • includes

      public List<String> includes()
      Returns the value of the includes record component.
      Returns:
      the value of the includes record component
    • excludes

      public List<String> excludes()
      Returns the value of the excludes record component.
      Returns:
      the value of the excludes record component