Record Class AnnotatedCompositeCodeTransformer

java.lang.Object
java.lang.Record
tech.picnic.errorprone.refaster.AnnotatedCompositeCodeTransformer
Record Components:
packageName - The package in which the wrapped CodeTransformers reside.
transformers - The CodeTransformers to which to delegate.
annotations - The annotations that are applicable to this CodeTransformer.
All Implemented Interfaces:
com.google.errorprone.CodeTransformer, Serializable

public record AnnotatedCompositeCodeTransformer(String packageName, com.google.common.collect.ImmutableList<com.google.errorprone.CodeTransformer> transformers, com.google.common.collect.ImmutableClassToInstanceMap<Annotation> annotations) extends Record implements com.google.errorprone.CodeTransformer, Serializable
A CompositeCodeTransformer that augments the Description of Refaster rule matches.

The content is augmented based on custom annotations available on the matching CodeTransformer or on this CompositeCodeTransformer as a fallback, if any.

See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    AnnotatedCompositeCodeTransformer(String packageName, com.google.common.collect.ImmutableList<com.google.errorprone.CodeTransformer> transformers, com.google.common.collect.ImmutableClassToInstanceMap<Annotation> annotations)
    Creates an instance of a AnnotatedCompositeCodeTransformer record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    com.google.common.collect.ImmutableClassToInstanceMap<Annotation>
    Returns the value of the annotations record component.
    void
    apply(TreePath path, com.sun.tools.javac.util.Context context, com.google.errorprone.DescriptionListener listener)
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    Returns the value of the packageName record component.
    final String
    Returns a string representation of this record class.
    com.google.common.collect.ImmutableList<com.google.errorprone.CodeTransformer>
    Returns the value of the transformers record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • AnnotatedCompositeCodeTransformer

      public AnnotatedCompositeCodeTransformer(String packageName, com.google.common.collect.ImmutableList<com.google.errorprone.CodeTransformer> transformers, com.google.common.collect.ImmutableClassToInstanceMap<Annotation> annotations)
      Creates an instance of a AnnotatedCompositeCodeTransformer record class.
      Parameters:
      packageName - the value for the packageName record component
      transformers - the value for the transformers record component
      annotations - the value for the annotations record component
  • Method Details

    • apply

      public void apply(TreePath path, com.sun.tools.javac.util.Context context, com.google.errorprone.DescriptionListener listener)
      Specified by:
      apply in interface com.google.errorprone.CodeTransformer
    • 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.
    • packageName

      public String packageName()
      Returns the value of the packageName record component.
      Returns:
      the value of the packageName record component
    • transformers

      public com.google.common.collect.ImmutableList<com.google.errorprone.CodeTransformer> transformers()
      Returns the value of the transformers record component.
      Returns:
      the value of the transformers record component
    • annotations

      public com.google.common.collect.ImmutableClassToInstanceMap<Annotation> annotations()
      Returns the value of the annotations record component.
      Specified by:
      annotations in interface com.google.errorprone.CodeTransformer
      Returns:
      the value of the annotations record component