Package net.bytebuddy.description.method
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 java.lang.Object implements ByteCodeElement.Token<ParameterDescription.Token>
A token representing a parameter's properties detached from a type.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ParameterDescription.Token.TypeList
A list of types represented as a list of parameter tokens.-
Nested classes/interfaces inherited from interface net.bytebuddy.description.ByteCodeElement.Token
ByteCodeElement.Token.TokenList<S extends ByteCodeElement.Token<S>>
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.Integer
NO_MODIFIERS
Indicator for a method parameter without explicit modifiers.static java.lang.String
NO_NAME
Indicator for a method parameter without an explicit name.
-
Constructor Summary
Constructors Constructor Description Token(TypeDescription.Generic type)
Creates a new parameter token without an explicit name, an explicit modifier or annotations.Token(TypeDescription.Generic type, java.lang.String name, java.lang.Integer modifiers)
Creates a parameter token without annotations.Token(TypeDescription.Generic type, java.util.List<? extends AnnotationDescription> annotations)
Creates a new parameter token without an explicit name or an explicit modifier.Token(TypeDescription.Generic type, java.util.List<? extends AnnotationDescription> annotations, java.lang.String name, java.lang.Integer modifiers)
Creates a new parameter token.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ParameterDescription.Token
accept(TypeDescription.Generic.Visitor<? extends TypeDescription.Generic> visitor)
Transforms the types represented by this token by applying the given visitor to them.boolean
equals(java.lang.Object other)
AnnotationList
getAnnotations()
Returns the annotations of the represented method parameter.java.lang.Integer
getModifiers()
Returns the modifiers of the represented method parameter.java.lang.String
getName()
Returns the name of the represented method parameter.TypeDescription.Generic
getType()
Returns the type of the represented method parameter.int
hashCode()
java.lang.String
toString()
-
-
-
Constructor Detail
-
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, java.util.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, java.lang.String name, java.lang.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 ornull
if no explicit name is defined.modifiers
- The modifiers of the parameter ornull
if no explicit modifiers is defined.
-
Token
public Token(TypeDescription.Generic type, java.util.List<? extends AnnotationDescription> annotations, java.lang.String name, java.lang.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 ornull
if no explicit name is defined.modifiers
- The modifiers of the parameter ornull
if no explicit modifiers is defined.
-
-
Method Detail
-
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
public java.lang.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
public java.lang.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
public ParameterDescription.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<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.
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-