Package tech.picnic.errorprone.refaster
Record Class AnnotatedCompositeCodeTransformer
java.lang.Object
java.lang.Record
tech.picnic.errorprone.refaster.AnnotatedCompositeCodeTransformer
- Record Components:
packageName- The package in which the wrappedCodeTransformers reside.transformers- TheCodeTransformers to which to delegate.annotations- The annotations that are applicable to thisCodeTransformer.
- 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
ConstructorsConstructorDescriptionAnnotatedCompositeCodeTransformer(String packageName, com.google.common.collect.ImmutableList<com.google.errorprone.CodeTransformer> transformers, com.google.common.collect.ImmutableClassToInstanceMap<Annotation> annotations) Creates an instance of aAnnotatedCompositeCodeTransformerrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.google.common.collect.ImmutableClassToInstanceMap<Annotation> Returns the value of theannotationsrecord component.voidapply(TreePath path, com.sun.tools.javac.util.Context context, com.google.errorprone.DescriptionListener listener) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thepackageNamerecord component.final StringtoString()Returns a string representation of this record class.com.google.common.collect.ImmutableList<com.google.errorprone.CodeTransformer> Returns the value of thetransformersrecord component.
-
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 aAnnotatedCompositeCodeTransformerrecord class.- Parameters:
packageName- the value for thepackageNamerecord componenttransformers- the value for thetransformersrecord componentannotations- the value for theannotationsrecord component
-
-
Method Details
-
apply
public void apply(TreePath path, com.sun.tools.javac.util.Context context, com.google.errorprone.DescriptionListener listener) - Specified by:
applyin interfacecom.google.errorprone.CodeTransformer
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
packageName
Returns the value of thepackageNamerecord component.- Returns:
- the value of the
packageNamerecord component
-
transformers
public com.google.common.collect.ImmutableList<com.google.errorprone.CodeTransformer> transformers()Returns the value of thetransformersrecord component.- Returns:
- the value of the
transformersrecord component
-
annotations
Returns the value of theannotationsrecord component.- Specified by:
annotationsin interfacecom.google.errorprone.CodeTransformer- Returns:
- the value of the
annotationsrecord component
-