Package net.bytebuddy.build
Class ToStringPlugin
- java.lang.Object
-
- net.bytebuddy.build.ToStringPlugin
-
- All Implemented Interfaces:
Plugin
,ElementMatcher<TypeDescription>
public class ToStringPlugin extends java.lang.Object implements Plugin
A build tool plugin that adds aObject.toString()
and method to a class if theToStringPlugin.Enhance
annotation is present and no explicit method declaration was added.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ToStringPlugin.Enhance
Instructs theToStringPlugin
to generate aObject.toString()
method for the annotated class unless this method is already declared explicitly.static interface
ToStringPlugin.Exclude
Determines that the annotated field is excluded from a string representation of theToStringPlugin
.-
Nested classes/interfaces inherited from interface net.bytebuddy.matcher.ElementMatcher
ElementMatcher.Junction<S>
-
-
Constructor Summary
Constructors Constructor Description ToStringPlugin()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DynamicType.Builder<?>
apply(DynamicType.Builder<?> builder, TypeDescription typeDescription)
Applies this plugin.boolean
matches(TypeDescription target)
Matches a target against this element matcher.
-
-
-
Method Detail
-
matches
public boolean matches(TypeDescription target)
Description copied from interface:ElementMatcher
Matches a target against this element matcher.- Specified by:
matches
in interfaceElementMatcher<TypeDescription>
- Parameters:
target
- The instance to be matched.- Returns:
true
if the given element is matched by this matcher orfalse
otherwise.
-
apply
public DynamicType.Builder<?> apply(DynamicType.Builder<?> builder, TypeDescription typeDescription)
Description copied from interface:Plugin
Applies this plugin.
-
-