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 java.lang.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
Fields Modifier and Type Field Description private FieldDescription
fieldDescription
A description of the located field.
-
Constructor Summary
Constructors Modifier Constructor Description protected
Simple(FieldDescription fieldDescription)
Creates a new simple resolution for a field.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description FieldDescription
getField()
Returns the field description if a field was located.boolean
isResolved()
Returnstrue
if a field was located.static FieldLocator.Resolution
ofBeanAccessor(FieldLocator fieldLocator, MethodDescription methodDescription)
Resolves a field locator for a potential accessor method.
-
-
-
Field Detail
-
fieldDescription
private final FieldDescription fieldDescription
A description of the located field.
-
-
Constructor Detail
-
Simple
protected Simple(FieldDescription fieldDescription)
Creates a new simple resolution for a field.- Parameters:
fieldDescription
- A description of the located field.
-
-
Method Detail
-
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
public FieldDescription 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.
-
-