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 private java.util.List<? extends AnnotationDescription>
annotations
A list of parameter annotations.private java.lang.Integer
modifiers
The modifiers of the parameter ornull
if no explicit modifiers is defined.private java.lang.String
name
The name of the parameter ornull
if no explicit name is defined.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.private TypeDescription.Generic
type
The type of the represented parameter.
-
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()
-
-
-
Field Detail
-
NO_NAME
public static final java.lang.String NO_NAME
Indicator for a method parameter without an explicit name.
-
NO_MODIFIERS
public static final java.lang.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 java.util.List<? extends AnnotationDescription> annotations
A list of parameter annotations.
-
name
private final java.lang.String name
The name of the parameter ornull
if no explicit name is defined.
-
modifiers
private final java.lang.Integer modifiers
The modifiers of the parameter ornull
if no explicit modifiers is defined.
-
-
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)
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
@Enhance("hashCode") public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-