public static class MethodDescription.Token extends Object implements ByteCodeElement.Token<MethodDescription.Token>
ByteCodeElement.Token.TokenList<S extends ByteCodeElement.Token<S>>
Constructor and Description |
---|
Token(int modifiers)
Creates a new method token representing a constructor without any parameters, exception types, type variables or annotations.
|
Token(String name,
int modifiers,
List<? extends TypeVariableToken> typeVariableTokens,
TypeDescription.Generic returnType,
List<? extends ParameterDescription.Token> parameterTokens,
List<? extends TypeDescription.Generic> exceptionTypes,
List<? extends AnnotationDescription> annotations,
AnnotationValue<?,?> defaultValue,
TypeDescription.Generic receiverType)
Creates a new token for a method description.
|
Token(String name,
int modifiers,
TypeDescription.Generic returnType)
Creates a new method token representing a method without any parameters, exception types, type variables or annotations.
|
Token(String name,
int modifiers,
TypeDescription.Generic returnType,
List<? extends TypeDescription.Generic> parameterTypes)
Creates a new method token with simple values.
|
Modifier and Type | Method and Description |
---|---|
MethodDescription.Token |
accept(TypeDescription.Generic.Visitor<? extends TypeDescription.Generic> visitor)
Transforms the types represented by this token by applying the given visitor to them.
|
MethodDescription.SignatureToken |
asSignatureToken(TypeDescription declaringType)
Creates a signature token that represents the method that is represented by this token.
|
boolean |
equals(Object other) |
AnnotationList |
getAnnotations()
Returns the annotations of the represented method.
|
AnnotationValue<?,?> |
getDefaultValue()
Returns the default value of the represented method.
|
TypeList.Generic |
getExceptionTypes()
Returns the exception types of the represented method.
|
int |
getModifiers()
Returns the modifiers of the represented method.
|
String |
getName()
Returns the internal name of the represented method.
|
ByteCodeElement.Token.TokenList<ParameterDescription.Token> |
getParameterTokens()
Returns the parameter tokens of the represented method.
|
TypeDescription.Generic |
getReceiverType()
Returns the receiver type of this token or
null if the receiver type is implicit. |
TypeDescription.Generic |
getReturnType()
Returns the return type of the represented method.
|
ByteCodeElement.Token.TokenList<TypeVariableToken> |
getTypeVariableTokens()
Returns the type variables of this method token.
|
int |
hashCode() |
String |
toString() |
public Token(int modifiers)
modifiers
- The constructor's modifiers.public Token(String name, int modifiers, TypeDescription.Generic returnType)
name
- The name of the method.modifiers
- The modifiers of the method.returnType
- The return type of the method.public Token(String name, int modifiers, TypeDescription.Generic returnType, List<? extends TypeDescription.Generic> parameterTypes)
name
- The internal name of the represented method.modifiers
- The modifiers of the represented method.returnType
- The return type of the represented method.parameterTypes
- The parameter types of this method.public Token(String name, int modifiers, List<? extends TypeVariableToken> typeVariableTokens, TypeDescription.Generic returnType, List<? extends ParameterDescription.Token> parameterTokens, List<? extends TypeDescription.Generic> exceptionTypes, List<? extends AnnotationDescription> annotations, @MaybeNull AnnotationValue<?,?> defaultValue, @MaybeNull TypeDescription.Generic receiverType)
name
- The internal name of the represented method.modifiers
- The modifiers of the represented method.typeVariableTokens
- The type variables of the the represented method.returnType
- The return type of the represented method.parameterTokens
- The parameter tokens of the represented method.exceptionTypes
- The exception types of the represented method.annotations
- The annotations of the represented method.defaultValue
- The default value of the represented method or null
if no such value exists.receiverType
- The receiver type of the represented method or null
if the receiver type is implicit.public String getName()
public int getModifiers()
public ByteCodeElement.Token.TokenList<TypeVariableToken> getTypeVariableTokens()
public TypeDescription.Generic getReturnType()
public ByteCodeElement.Token.TokenList<ParameterDescription.Token> getParameterTokens()
public TypeList.Generic getExceptionTypes()
public AnnotationList getAnnotations()
@MaybeNull public AnnotationValue<?,?> getDefaultValue()
null
if no such value exists.@MaybeNull public TypeDescription.Generic getReceiverType()
null
if the receiver type is implicit.null
if the receiver type is implicit.public MethodDescription.Token accept(TypeDescription.Generic.Visitor<? extends TypeDescription.Generic> visitor)
accept
in interface ByteCodeElement.Token<MethodDescription.Token>
visitor
- The visitor to transform all types that are represented by this token.public MethodDescription.SignatureToken asSignatureToken(TypeDescription declaringType)
declaringType
- The declaring type of the method that this token represents.@CachedReturnPlugin.Enhance(value="hashCode") public int hashCode()
public boolean equals(@MaybeNull Object other)
Copyright © 2014–2024. All rights reserved.