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 Object
implements ByteCodeElement.Token<ParameterDescription.Token>
A token representing a parameter's properties detached from a type.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
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
FieldsModifier and TypeFieldDescriptionprivate final List
<? extends AnnotationDescription> A list of parameter annotations.private final Integer
The modifiers of the parameter ornull
if no explicit modifiers is defined.private final String
The name of the parameter ornull
if no explicit name is defined.static final Integer
Indicator for a method parameter without explicit modifiers.static final String
Indicator for a method parameter without an explicit name.private final TypeDescription.Generic
The type of the represented parameter. -
Constructor Summary
ConstructorsConstructorDescriptionToken
(TypeDescription.Generic type) Creates a new parameter token without an explicit name, an explicit modifier or annotations.Token
(TypeDescription.Generic type, String name, Integer modifiers) Creates a parameter token without annotations.Token
(TypeDescription.Generic type, List<? extends AnnotationDescription> annotations) Creates a new parameter token without an explicit name or an explicit modifier.Token
(TypeDescription.Generic type, List<? extends AnnotationDescription> annotations, String name, Integer modifiers) Creates a new parameter 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.boolean
Returns the annotations of the represented method parameter.Returns the modifiers of the represented method parameter.getName()
Returns the name of the represented method parameter.getType()
Returns the type of the represented method parameter.int
hashCode()
toString()
-
Field Details
-
NO_NAME
Indicator for a method parameter without an explicit name. -
NO_MODIFIERS
Indicator for a method parameter without explicit modifiers. -
type
The type of the represented parameter. -
annotations
A list of parameter annotations. -
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.
-
-
Constructor Details
-
Token
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
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
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, 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 ornull
if no explicit name is defined.modifiers
- The modifiers of the parameter ornull
if no explicit modifiers is defined.
-
-
Method Details
-
getType
Returns the type of the represented method parameter.- Returns:
- The type of the represented method parameter.
-
getAnnotations
Returns the annotations of the represented method parameter.- Returns:
- The annotations of the represented method parameter.
-
getName
Returns the name of the represented method parameter.- Returns:
- The name of the parameter or
null
if no explicit name is defined.
-
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) 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.
-
hashCode
-
equals
-
toString
-