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.
  • Field Details

    • name

      private final String name
      The name of the represented field.
    • modifiers

      private final int modifiers
      The modifiers of the represented field.
    • type

      private final TypeDescription.Generic type
      The type of the represented field.
    • annotations

      private final List<? extends AnnotationDescription> annotations
      The annotations of the represented field.
  • Constructor Details

    • Token

      public Token(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(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

      public 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

      Transforms the types represented by this token by applying the given visitor to them.
      Specified by:
      accept in interface ByteCodeElement.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.
    • hashCode

      @Enhance("hashCode") public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(@MaybeNull Object other)
      Overrides:
      equals in class Object