Record Class CompositeCodeTransformer
java.lang.Object
java.lang.Record
com.google.errorprone.CompositeCodeTransformer
- All Implemented Interfaces:
CodeTransformer, Serializable
public record CompositeCodeTransformer(com.google.common.collect.ImmutableList<CodeTransformer> transformers)
extends Record
implements CodeTransformer, Serializable
Combines multiple
CodeTransformers into one.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCompositeCodeTransformer(com.google.common.collect.ImmutableList<CodeTransformer> transformers) Creates an instance of aCompositeCodeTransformerrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.google.common.collect.ImmutableClassToInstanceMap<Annotation> Returns a map of annotation data logically applied to this code transformer.voidapply(TreePath path, com.sun.tools.javac.util.Context context, DescriptionListener listener) Apply recursively from the leaf node in the givenTreePath.static CodeTransformercompose(CodeTransformer... transformers) static CodeTransformercompose(Iterable<? extends CodeTransformer> transformers) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.com.google.common.collect.ImmutableList<CodeTransformer> Returns the value of thetransformersrecord component.
-
Constructor Details
-
CompositeCodeTransformer
public CompositeCodeTransformer(com.google.common.collect.ImmutableList<CodeTransformer> transformers) Creates an instance of aCompositeCodeTransformerrecord class.- Parameters:
transformers- the value for thetransformersrecord component
-
-
Method Details
-
compose
-
compose
-
apply
public void apply(TreePath path, com.sun.tools.javac.util.Context context, DescriptionListener listener) Description copied from interface:CodeTransformerApply recursively from the leaf node in the givenTreePath.- Specified by:
applyin interfaceCodeTransformer
-
annotations
Description copied from interface:CodeTransformerReturns a map of annotation data logically applied to this code transformer.As an example, if a
CodeTransformerexpressed as a Refaster rule had an annotation applied to it:
You could retrieve the value of@MyCustomAnnotation("value") public class AnnotatedRefasterRule { @BeforeTemplate void before(String x) {...} @AfterTemplate void after(String x) {...} }@MyCustomAnnotationfrom this map.- Specified by:
annotationsin interfaceCodeTransformer
-
toString
-
hashCode
-
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). -
transformers
Returns the value of thetransformersrecord component.- Returns:
- the value of the
transformersrecord component
-