Class ParameterDescription.Token

java.lang.Object
net.bytebuddy.description.method.ParameterDescription.Token
All Implemented Interfaces:
ByteCodeElement.Token<ParameterDescription.Token>
Enclosing interface:
ParameterDescription

public static class ParameterDescription.Token extends Object implements ByteCodeElement.Token<ParameterDescription.Token>
A token representing a parameter's properties detached from a type.
  • Field Details

    • NO_NAME

      @AlwaysNull public static final String NO_NAME
      Indicator for a method parameter without an explicit name.
    • NO_MODIFIERS

      @AlwaysNull public static final Integer NO_MODIFIERS
      Indicator for a method parameter without explicit modifiers.
    • type

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

      private final List<? extends AnnotationDescription> annotations
      A list of parameter annotations.
    • name

      @MaybeNull private final String name
      The name of the parameter or null if no explicit name is defined.
    • modifiers

      @MaybeNull private final Integer modifiers
      The modifiers of the parameter or null if no explicit modifiers is defined.
  • Constructor Details

    • Token

      public Token(TypeDescription.Generic type)
      Creates a new parameter token without an explicit name, an explicit modifier or annotations. The parameter type must be represented in its detached format.
      Parameters:
      type - The type of the represented parameter.
    • Token

      public Token(TypeDescription.Generic type, List<? extends AnnotationDescription> annotations)
      Creates a new parameter token without an explicit name or an explicit modifier. The parameter type must be represented in its detached format.
      Parameters:
      type - The type of the represented parameter.
      annotations - The annotations of the parameter.
    • Token

      public Token(TypeDescription.Generic type, @MaybeNull String name, @MaybeNull Integer modifiers)
      Creates a parameter token without annotations. The parameter type must be represented in its detached format.
      Parameters:
      type - The type of the represented parameter.
      name - The name of the parameter or null if no explicit name is defined.
      modifiers - The modifiers of the parameter or null if no explicit modifiers is defined.
    • Token

      public Token(TypeDescription.Generic type, List<? extends AnnotationDescription> annotations, @MaybeNull String name, @MaybeNull Integer modifiers)
      Creates a new parameter token. The parameter type must be represented in its detached format.
      Parameters:
      type - The type of the represented parameter.
      annotations - The annotations of the parameter.
      name - The name of the parameter or null if no explicit name is defined.
      modifiers - The modifiers of the parameter or null if no explicit modifiers is defined.
  • Method Details

    • getType

      public TypeDescription.Generic getType()
      Returns the type of the represented method parameter.
      Returns:
      The type of the represented method parameter.
    • getAnnotations

      public AnnotationList getAnnotations()
      Returns the annotations of the represented method parameter.
      Returns:
      The annotations of the represented method parameter.
    • getName

      @MaybeNull public String getName()
      Returns the name of the represented method parameter.
      Returns:
      The name of the parameter or null if no explicit name is defined.
    • getModifiers

      @MaybeNull public Integer getModifiers()
      Returns the modifiers of the represented method parameter.
      Returns:
      The modifiers of the parameter or null if no explicit modifiers is defined.
    • accept

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

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

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

      public String toString()
      Overrides:
      toString in class Object