Package net.bytebuddy.description.field
Class FieldDescription.Token
java.lang.Object
net.bytebuddy.description.field.FieldDescription.Token
- All Implemented Interfaces:
ByteCodeElement.Token<FieldDescription.Token>
- Enclosing interface:
FieldDescription
public static class FieldDescription.Token
extends Object
implements ByteCodeElement.Token<FieldDescription.Token>
A token representing a field's properties detached from a type.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.bytebuddy.description.ByteCodeElement.Token
ByteCodeElement.Token.TokenList<S extends ByteCodeElement.Token<S>>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List
<? extends AnnotationDescription> The annotations of the represented field.private final int
The modifiers of the represented field.private final String
The name of the represented field.private final TypeDescription.Generic
The type of the represented field. -
Constructor Summary
ConstructorsConstructorDescriptionToken
(String name, int modifiers, TypeDescription.Generic type) Creates a new field token without annotations.Token
(String name, int modifiers, TypeDescription.Generic type, List<? extends AnnotationDescription> annotations) Creates a new field token. -
Method Summary
Modifier and TypeMethodDescriptionaccept
(TypeDescription.Generic.Visitor<? extends TypeDescription.Generic> visitor) Transforms the types represented by this token by applying the given visitor to them.asSignatureToken
(TypeDescription declaringType) Creates a signature token that represents the method that is represented by this token.boolean
Returns the annotations of the represented field.int
Returns the modifiers of the represented field.getName()
Returns the name of the represented field.getType()
Returns the type of the represented field.int
hashCode()
-
Field Details
-
name
The name of the represented field. -
modifiers
private final int modifiersThe modifiers of the represented field. -
type
The type of the represented field. -
annotations
The annotations of the represented field.
-
-
Constructor Details
-
Token
Creates a new field token without annotations. The field type must be represented in its detached form.- Parameters:
name
- The name of the represented field.modifiers
- The modifiers of the represented field.type
- The type of the represented field.
-
Token
public Token(String name, int modifiers, TypeDescription.Generic type, List<? extends AnnotationDescription> annotations) Creates a new field token. The field type must be represented in its detached form.- Parameters:
name
- The name of the represented field.modifiers
- The modifiers of the represented field.type
- The type of the represented field.annotations
- The annotations of the represented field.
-
-
Method Details
-
getName
Returns the name of the represented field.- Returns:
- The name of the represented field.
-
getType
Returns the type of the represented field.- Returns:
- The type of the represented field.
-
getModifiers
public int getModifiers()Returns the modifiers of the represented field.- Returns:
- The modifiers of the represented field.
-
getAnnotations
Returns the annotations of the represented field.- Returns:
- The annotations of the represented field.
-
accept
public FieldDescription.Token accept(TypeDescription.Generic.Visitor<? extends TypeDescription.Generic> visitor) Transforms the types represented by this token by applying the given visitor to them.- Specified by:
accept
in interfaceByteCodeElement.Token<FieldDescription.Token>
- Parameters:
visitor
- The visitor to transform all types that are represented by this token.- Returns:
- This token with all of its represented types transformed by the supplied visitor.
-
asSignatureToken
Creates a signature token that represents the method that is represented by this token.- Parameters:
declaringType
- The declaring type of the field that this token represents.- Returns:
- A signature token representing this token.
-
hashCode
-
equals
-