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 java.lang.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>>
-
-
Constructor Summary
Constructors Constructor Description Token(java.lang.String name, int modifiers, TypeDescription.Generic type)
Creates a new field token without annotations.Token(java.lang.String name, int modifiers, TypeDescription.Generic type, java.util.List<? extends AnnotationDescription> annotations)
Creates a new field token.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FieldDescription.Token
accept(TypeDescription.Generic.Visitor<? extends TypeDescription.Generic> visitor)
Transforms the types represented by this token by applying the given visitor to them.FieldDescription.SignatureToken
asSignatureToken(TypeDescription declaringType)
Creates a signature token that represents the method that is represented by this token.boolean
equals(java.lang.Object other)
AnnotationList
getAnnotations()
Returns the annotations of the represented field.int
getModifiers()
Returns the modifiers of the represented field.java.lang.String
getName()
Returns the name of the represented field.TypeDescription.Generic
getType()
Returns the type of the represented field.int
hashCode()
-
-
-
Constructor Detail
-
Token
public Token(java.lang.String name, int modifiers, TypeDescription.Generic type)
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(java.lang.String name, int modifiers, TypeDescription.Generic type, java.util.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 Detail
-
getName
public java.lang.String getName()
Returns the name of the represented field.- Returns:
- The name of the represented field.
-
getType
public TypeDescription.Generic 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
public AnnotationList 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)
Description copied from interface:ByteCodeElement.Token
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
public FieldDescription.SignatureToken asSignatureToken(TypeDescription declaringType)
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.
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-