Record Class Configuration<T>

java.lang.Object
java.lang.Record
nl.jqno.equalsverifier.internal.util.Configuration<T>

public record Configuration<T>(Class<T> type, TypeTag typeTag, InstanceFactory<T> factory, InstanceFactory<? extends T> subclassFactory, Set<String> ignoredFields, Set<String> nonnullFields, Set<String> prefabbedFields, AnnotationCache annotationCache, CachedHashCodeInitializer<T> cachedHashCodeInitializer, boolean hasRedefinedSuperclass, InstanceFactory<?> redefinedSuperclassFactory, Class<? extends T> redefinedSubclass, InstanceFactory<? extends T> redefinedSubclassFactory, boolean usingGetClass, EnumSet<Warning> warningsToSuppress, Set<Mode> modes, Function<String,String> fieldnameToGetter, boolean isKotlin, List<T> equalExamples, List<T> unequalExamples) extends Record
  • Field Details

    • type

      private final Class<T> type
      The field for the type record component.
    • typeTag

      private final TypeTag typeTag
      The field for the typeTag record component.
    • factory

      private final InstanceFactory<T> factory
      The field for the factory record component.
    • subclassFactory

      private final InstanceFactory<? extends T> subclassFactory
      The field for the subclassFactory record component.
    • ignoredFields

      private final Set<String> ignoredFields
      The field for the ignoredFields record component.
    • nonnullFields

      private final Set<String> nonnullFields
      The field for the nonnullFields record component.
    • prefabbedFields

      private final Set<String> prefabbedFields
      The field for the prefabbedFields record component.
    • annotationCache

      private final AnnotationCache annotationCache
      The field for the annotationCache record component.
    • cachedHashCodeInitializer

      private final CachedHashCodeInitializer<T> cachedHashCodeInitializer
      The field for the cachedHashCodeInitializer record component.
    • hasRedefinedSuperclass

      private final boolean hasRedefinedSuperclass
      The field for the hasRedefinedSuperclass record component.
    • redefinedSuperclassFactory

      private final InstanceFactory<?> redefinedSuperclassFactory
      The field for the redefinedSuperclassFactory record component.
    • redefinedSubclass

      private final Class<? extends T> redefinedSubclass
      The field for the redefinedSubclass record component.
    • redefinedSubclassFactory

      private final InstanceFactory<? extends T> redefinedSubclassFactory
      The field for the redefinedSubclassFactory record component.
    • usingGetClass

      private final boolean usingGetClass
      The field for the usingGetClass record component.
    • warningsToSuppress

      private final EnumSet<Warning> warningsToSuppress
      The field for the warningsToSuppress record component.
    • modes

      private final Set<Mode> modes
      The field for the modes record component.
    • fieldnameToGetter

      private final Function<String,String> fieldnameToGetter
      The field for the fieldnameToGetter record component.
    • isKotlin

      private final boolean isKotlin
      The field for the isKotlin record component.
    • equalExamples

      private final List<T> equalExamples
      The field for the equalExamples record component.
    • unequalExamples

      private final List<T> unequalExamples
      The field for the unequalExamples record component.
  • Constructor Details

    • Configuration

      public Configuration(Class<T> type, TypeTag typeTag, InstanceFactory<T> factory, InstanceFactory<? extends T> subclassFactory, Set<String> ignoredFields, Set<String> nonnullFields, Set<String> prefabbedFields, AnnotationCache annotationCache, CachedHashCodeInitializer<T> cachedHashCodeInitializer, boolean hasRedefinedSuperclass, InstanceFactory<?> redefinedSuperclassFactory, Class<? extends T> redefinedSubclass, InstanceFactory<? extends T> redefinedSubclassFactory, boolean usingGetClass, EnumSet<Warning> warningsToSuppress, Set<Mode> modes, Function<String,String> fieldnameToGetter, boolean isKotlin, List<T> equalExamples, List<T> unequalExamples)
      Creates an instance of a Configuration record class.
      Parameters:
      type - the value for the type record component
      typeTag - the value for the typeTag record component
      factory - the value for the factory record component
      subclassFactory - the value for the subclassFactory record component
      ignoredFields - the value for the ignoredFields record component
      nonnullFields - the value for the nonnullFields record component
      prefabbedFields - the value for the prefabbedFields record component
      annotationCache - the value for the annotationCache record component
      cachedHashCodeInitializer - the value for the cachedHashCodeInitializer record component
      hasRedefinedSuperclass - the value for the hasRedefinedSuperclass record component
      redefinedSuperclassFactory - the value for the redefinedSuperclassFactory record component
      redefinedSubclass - the value for the redefinedSubclass record component
      redefinedSubclassFactory - the value for the redefinedSubclassFactory record component
      usingGetClass - the value for the usingGetClass record component
      warningsToSuppress - the value for the warningsToSuppress record component
      modes - the value for the modes record component
      fieldnameToGetter - the value for the fieldnameToGetter record component
      isKotlin - the value for the isKotlin record component
      equalExamples - the value for the equalExamples record component
      unequalExamples - the value for the unequalExamples record component
  • Method Details

    • build

      public static <T> Configuration<T> build(Class<T> type, InstanceFactory<T> factory, InstanceFactory<? extends T> subclassFactory, Set<String> excludedFields, Set<String> includedFields, Set<String> nonnullFields, Set<String> prefabbedFields, CachedHashCodeInitializer<T> cachedHashCodeInitializer, boolean hasRedefinedSuperclass, InstanceFactory<?> redefinedSuperclassFactory, Class<? extends T> redefinedSubclass, InstanceFactory<? extends T> redefinedSubclassFactory, boolean usingGetClass, EnumSet<Warning> warningsToSuppress, Set<Mode> modes, Function<String,String> fieldnameToGetter, Set<String> ignoredAnnotationClassNames, Set<String> actualFields, List<T> equalExamples, List<T> unequalExamples)
    • buildAnnotationCache

      private static <T> AnnotationCache buildAnnotationCache(Class<T> type, Set<String> ignoredAnnotationClassNames)
    • determineIgnoredFields

      private static <T> Set<String> determineIgnoredFields(Class<T> type, AnnotationCache annotationCache, EnumSet<Warning> warningsToSuppress, Set<String> excludedFields, Set<String> includedFields, Set<String> actualFields)
    • determineAnnotationlessIgnoredFields

      private static Set<String> determineAnnotationlessIgnoredFields(Set<String> excludedFields, Set<String> includedFields, Set<String> actualFields)
    • defaulFieldNameToGetterConverter

      private static String defaulFieldNameToGetterConverter(String fieldName)
    • 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 '=='.
      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.
    • type

      public Class<T> type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • typeTag

      public TypeTag typeTag()
      Returns the value of the typeTag record component.
      Returns:
      the value of the typeTag record component
    • factory

      public InstanceFactory<T> factory()
      Returns the value of the factory record component.
      Returns:
      the value of the factory record component
    • subclassFactory

      public InstanceFactory<? extends T> subclassFactory()
      Returns the value of the subclassFactory record component.
      Returns:
      the value of the subclassFactory record component
    • ignoredFields

      public Set<String> ignoredFields()
      Returns the value of the ignoredFields record component.
      Returns:
      the value of the ignoredFields record component
    • nonnullFields

      public Set<String> nonnullFields()
      Returns the value of the nonnullFields record component.
      Returns:
      the value of the nonnullFields record component
    • prefabbedFields

      public Set<String> prefabbedFields()
      Returns the value of the prefabbedFields record component.
      Returns:
      the value of the prefabbedFields record component
    • annotationCache

      public AnnotationCache annotationCache()
      Returns the value of the annotationCache record component.
      Returns:
      the value of the annotationCache record component
    • cachedHashCodeInitializer

      public CachedHashCodeInitializer<T> cachedHashCodeInitializer()
      Returns the value of the cachedHashCodeInitializer record component.
      Returns:
      the value of the cachedHashCodeInitializer record component
    • hasRedefinedSuperclass

      public boolean hasRedefinedSuperclass()
      Returns the value of the hasRedefinedSuperclass record component.
      Returns:
      the value of the hasRedefinedSuperclass record component
    • redefinedSuperclassFactory

      public InstanceFactory<?> redefinedSuperclassFactory()
      Returns the value of the redefinedSuperclassFactory record component.
      Returns:
      the value of the redefinedSuperclassFactory record component
    • redefinedSubclass

      public Class<? extends T> redefinedSubclass()
      Returns the value of the redefinedSubclass record component.
      Returns:
      the value of the redefinedSubclass record component
    • redefinedSubclassFactory

      public InstanceFactory<? extends T> redefinedSubclassFactory()
      Returns the value of the redefinedSubclassFactory record component.
      Returns:
      the value of the redefinedSubclassFactory record component
    • usingGetClass

      public boolean usingGetClass()
      Returns the value of the usingGetClass record component.
      Returns:
      the value of the usingGetClass record component
    • warningsToSuppress

      public EnumSet<Warning> warningsToSuppress()
      Returns the value of the warningsToSuppress record component.
      Returns:
      the value of the warningsToSuppress record component
    • modes

      public Set<Mode> modes()
      Returns the value of the modes record component.
      Returns:
      the value of the modes record component
    • fieldnameToGetter

      public Function<String,String> fieldnameToGetter()
      Returns the value of the fieldnameToGetter record component.
      Returns:
      the value of the fieldnameToGetter record component
    • isKotlin

      public boolean isKotlin()
      Returns the value of the isKotlin record component.
      Returns:
      the value of the isKotlin record component
    • equalExamples

      public List<T> equalExamples()
      Returns the value of the equalExamples record component.
      Returns:
      the value of the equalExamples record component
    • unequalExamples

      public List<T> unequalExamples()
      Returns the value of the unequalExamples record component.
      Returns:
      the value of the unequalExamples record component