Class FieldProxy.Binder.FieldResolver.ForGetterSetterPair
java.lang.Object
net.bytebuddy.implementation.bind.annotation.FieldProxy.Binder.FieldResolver.ForGetterSetterPair
- All Implemented Interfaces:
FieldProxy.Binder.FieldResolver
- Enclosing interface:
FieldProxy.Binder.FieldResolver
@Enhance
public static class FieldProxy.Binder.FieldResolver.ForGetterSetterPair
extends Object
implements FieldProxy.Binder.FieldResolver
A field resolver for an accessor that both gets and sets a field value.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.bytebuddy.implementation.bind.annotation.FieldProxy.Binder.FieldResolver
FieldProxy.Binder.FieldResolver.Factory, FieldProxy.Binder.FieldResolver.ForGetter, FieldProxy.Binder.FieldResolver.ForGetterSetterPair, FieldProxy.Binder.FieldResolver.ForSetter, FieldProxy.Binder.FieldResolver.Unresolved
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final MethodDescription.InDefinedShape
The getter method.private final TypeDescription
The type of the accessor proxy.private final MethodDescription.InDefinedShape
The setter method. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ForGetterSetterPair
(TypeDescription proxyType, MethodDescription.InDefinedShape getterMethod, MethodDescription.InDefinedShape setterMethod) Creates a new field resolver for an accessor that both gets and sets a field value. -
Method Summary
Modifier and TypeMethodDescriptionapply
(DynamicType.Builder<?> builder, FieldDescription fieldDescription, Assigner assigner, MethodAccessorFactory methodAccessorFactory) Applies this field resolver to a dynamic type.Returns the type of the field access proxy.boolean
Returnstrue
if the field access can be established.
-
Field Details
-
proxyType
The type of the accessor proxy. -
getterMethod
The getter method. -
setterMethod
The setter method.
-
-
Constructor Details
-
ForGetterSetterPair
protected ForGetterSetterPair(TypeDescription proxyType, MethodDescription.InDefinedShape getterMethod, MethodDescription.InDefinedShape setterMethod) Creates a new field resolver for an accessor that both gets and sets a field value.- Parameters:
proxyType
- The type of the accessor proxy.getterMethod
- The getter method.setterMethod
- The setter method.
-
-
Method Details
-
isResolved
public boolean isResolved()Returnstrue
if the field access can be established.- Specified by:
isResolved
in interfaceFieldProxy.Binder.FieldResolver
- Returns:
true
if the field access can be established.
-
getProxyType
Returns the type of the field access proxy.- Specified by:
getProxyType
in interfaceFieldProxy.Binder.FieldResolver
- Returns:
- The type of the field access proxy.
-
apply
public DynamicType.Builder<?> apply(DynamicType.Builder<?> builder, FieldDescription fieldDescription, Assigner assigner, MethodAccessorFactory methodAccessorFactory) Applies this field resolver to a dynamic type.- Specified by:
apply
in interfaceFieldProxy.Binder.FieldResolver
- Parameters:
builder
- The dynamic type builder to use.fieldDescription
- The accessed field.assigner
- The assigner to use.methodAccessorFactory
- The method accessor factory to use.- Returns:
- The builder for creating the field accessor proxy type.
-