Record Class ImportOptions

java.lang.Object
java.lang.Record
dev.archunitjava.importer.ImportOptions

public record ImportOptions(ImportScope scope, List<ImportResourceRule> rules, boolean readArchIgnore, int maximumIgnoreBytes, int maximumIgnoreLines) extends Record
Immutable import semantics shared by directory and archive inputs.

The scope is a hard boundary. Within it resources are included initially, then root .archignore rules are applied in file order, followed by configured rules in list order. The last matching rule wins; a leading ! in .archignore is an include rule.

  • Field Details

    • DEFAULT_MAXIMUM_IGNORE_BYTES

      public static final int DEFAULT_MAXIMUM_IGNORE_BYTES
      See Also:
    • DEFAULT_MAXIMUM_IGNORE_LINES

      public static final int DEFAULT_MAXIMUM_IGNORE_LINES
      See Also:
  • Constructor Details

    • ImportOptions

      public ImportOptions(ImportScope scope, List<ImportResourceRule> rules, boolean readArchIgnore, int maximumIgnoreBytes, int maximumIgnoreLines)
      Creates an instance of a ImportOptions record class.
      Parameters:
      scope - the value for the scope record component
      rules - the value for the rules record component
      readArchIgnore - the value for the readArchIgnore record component
      maximumIgnoreBytes - the value for the maximumIgnoreBytes record component
      maximumIgnoreLines - the value for the maximumIgnoreLines record component
  • Method Details

    • defaults

      public static ImportOptions defaults()
    • withScope

      public ImportOptions withScope(ImportScope value)
    • withRule

      public ImportOptions withRule(ImportResourceRule value)
    • withoutArchIgnore

      public ImportOptions withoutArchIgnore()
    • fingerprintMaterial

      public String fingerprintMaterial()
      Stable material suitable for inclusion in cache keys.
    • 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.
    • scope

      public ImportScope scope()
      Returns the value of the scope record component.
      Returns:
      the value of the scope record component
    • rules

      public List<ImportResourceRule> rules()
      Returns the value of the rules record component.
      Returns:
      the value of the rules record component
    • readArchIgnore

      public boolean readArchIgnore()
      Returns the value of the readArchIgnore record component.
      Returns:
      the value of the readArchIgnore record component
    • maximumIgnoreBytes

      public int maximumIgnoreBytes()
      Returns the value of the maximumIgnoreBytes record component.
      Returns:
      the value of the maximumIgnoreBytes record component
    • maximumIgnoreLines

      public int maximumIgnoreLines()
      Returns the value of the maximumIgnoreLines record component.
      Returns:
      the value of the maximumIgnoreLines record component