Package net.bytebuddy.dynamic.scaffold
Class FieldLocator.Resolution.Simple
java.lang.Object
net.bytebuddy.dynamic.scaffold.FieldLocator.Resolution.Simple
- All Implemented Interfaces:
FieldLocator.Resolution
- Enclosing interface:
FieldLocator.Resolution
@Enhance
public static class FieldLocator.Resolution.Simple
extends Object
implements FieldLocator.Resolution
A simple implementation for a field resolution.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.scaffold.FieldLocator.Resolution
FieldLocator.Resolution.Illegal, FieldLocator.Resolution.Simple
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final FieldDescription
A description of the located field. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Simple
(FieldDescription fieldDescription) Creates a new simple resolution for a field. -
Method Summary
Modifier and TypeMethodDescriptiongetField()
Returns the field description if a field was located.boolean
Returnstrue
if a field was located.static FieldLocator.Resolution
ofBeanAccessor
(FieldLocator fieldLocator, MethodDescription methodDescription) Resolves a field locator for a potential accessor method.
-
Field Details
-
fieldDescription
A description of the located field.
-
-
Constructor Details
-
Simple
Creates a new simple resolution for a field.- Parameters:
fieldDescription
- A description of the located field.
-
-
Method Details
-
ofBeanAccessor
public static FieldLocator.Resolution ofBeanAccessor(FieldLocator fieldLocator, MethodDescription methodDescription) Resolves a field locator for a potential accessor method. If the provided method is not a bean accessor, an illegal resolution is returned.- Parameters:
fieldLocator
- The field locator to use.methodDescription
- The method description that is the potential accessor.- Returns:
- A resolution for a field locator.
-
isResolved
public boolean isResolved()Returnstrue
if a field was located.- Specified by:
isResolved
in interfaceFieldLocator.Resolution
- Returns:
true
if a field was located.
-
getField
Returns the field description if a field was located. This method must only be called if this resolution was actually resolved.- Specified by:
getField
in interfaceFieldLocator.Resolution
- Returns:
- The located field.
-