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 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.InDefinedShapeThe getter method.private final TypeDescriptionThe type of the accessor proxy.private final MethodDescription.InDefinedShapeThe setter method. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedForGetterSetterPair(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.booleanReturnstrueif 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()Returnstrueif the field access can be established.- Specified by:
isResolvedin interfaceFieldProxy.Binder.FieldResolver- Returns:
trueif the field access can be established.
-
getProxyType
Returns the type of the field access proxy.- Specified by:
getProxyTypein 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:
applyin 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.
-