Top Description Inners Fields Methods
net.bytebuddy.description

public Interface TypeVariableSource

extends OfAbstraction
Known Direct Subinterfaces
net.bytebuddy.description.method.MethodDescription, net.bytebuddy.description.type.TypeDescription
Known Direct Implementers
net.bytebuddy.description.TypeVariableSource.AbstractBase
Imports
net.bytebuddy.description.method.MethodDescription, net.bytebuddy.description.type.TypeDescription, .TypeList, net.bytebuddy.utility.nullability.AlwaysNull, .MaybeNull

A type variable source represents a code element that can declare type variables.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public abstract static class
TypeVariableSource.AbstractBase

An abstract base implementation of a type variable source.

public static interface
TypeVariableSource.Visitor<
The visitor's return type.
T
>

A visitor that can be applied to a type variable source.

Field Summary

Modifier and TypeField and Description
public static final TypeVariableSource
UNDEFINED

Indicates that a type variable source is undefined.

Method Summary

Modifier and TypeMethod and Description
public <
The visitor's return type.
T
>
T

Returns:

The visitor's return value.
accept
(TypeVariableSource.Visitor<T>
The visitor to apply.
visitor
)

Applies a visitor on this type variable source.

public TypeDescription.Generic

Returns:

The type variable.
findExpectedVariable
(String
The symbolic name of the type variable.
symbol
)

Finds a particular variable with the given name in the closes type variable source that is visible from this instance.

public TypeDescription.Generic

Returns:

The type variable or null if it was not found.
findVariable
(String
The symbolic name of the type variable.
symbol
)

Finds a particular variable with the given name in the closes type variable source that is visible from this instance.

public TypeVariableSource

Returns:

The enclosing source or null if no such source exists.
getEnclosingSource
()

Returns the enclosing source of type variables that are valid in the scope of this type variable source.

public TypeList.Generic

Returns:

The type variables that are declared by this element.
getTypeVariables
()

Returns the type variables that are declared by this element.

public boolean

Returns:

true if this type code element has a generic declaration.
isGenerified
()

Checks if this type variable source has a generic declaration.

public boolean

Returns:

true if type variables declared by this type variable source allow dynamic type inference.
isInferrable
()

Returns true if type variables declared by this type variable source allow dynamic type inference.

Inherited from net.bytebuddy.description.ModifierReviewable.OfAbstraction:
isAbstract

Field Detail

UNDEFINEDback to summary
public static final TypeVariableSource UNDEFINED

Indicates that a type variable source is undefined.

Annotations
@AlwaysNull

Method Detail

acceptback to summary
public <T> T accept(TypeVariableSource.Visitor<T> visitor)

Applies a visitor on this type variable source.

Parameters
<T>
The visitor's return type.
visitor:TypeVariableSource.Visitor<T>

The visitor to apply.

Returns:T

The visitor's return value.

findExpectedVariableback to summary
public TypeDescription.Generic findExpectedVariable(String symbol)

Finds a particular variable with the given name in the closes type variable source that is visible from this instance. If the variable is not found, an exception is thrown.

Parameters
symbol:String

The symbolic name of the type variable.

Returns:TypeDescription.Generic

The type variable.

findVariableback to summary
public TypeDescription.Generic findVariable(String symbol)

Finds a particular variable with the given name in the closes type variable source that is visible from this instance.

Parameters
symbol:String

The symbolic name of the type variable.

Returns:TypeDescription.Generic

The type variable or null if it was not found.

Annotations
@MaybeNull
getEnclosingSourceback to summary
public TypeVariableSource getEnclosingSource()

Returns the enclosing source of type variables that are valid in the scope of this type variable source.

Returns:TypeVariableSource

The enclosing source or null if no such source exists.

Annotations
@MaybeNull
getTypeVariablesback to summary
public TypeList.Generic getTypeVariables()

Returns the type variables that are declared by this element.

Returns:TypeList.Generic

The type variables that are declared by this element.

isGenerifiedback to summary
public boolean isGenerified()

Checks if this type variable source has a generic declaration. This means:

  • A type declares type variables or is an inner class of a type with a generic declaration.
  • A method declares at least one type variable.
  • A type is a class that is declared within a method with a generic declaration.
Returns:boolean

true if this type code element has a generic declaration.

isInferrableback to summary
public boolean isInferrable()

Returns true if type variables declared by this type variable source allow dynamic type inference.

Returns:boolean

true if type variables declared by this type variable source allow dynamic type inference.

net.bytebuddy.description back to summary

public abstract Class TypeVariableSource.AbstractBase

extends AbstractBase
implements TypeVariableSource
Class Inheritance
All Implemented Interfaces
net.bytebuddy.description.TypeVariableSource, net.bytebuddy.description.ModifierReviewable.OfAbstraction, net.bytebuddy.description.ModifierReviewable.OfByteCodeElement, net.bytebuddy.description.ModifierReviewable
Known Direct Subclasses
net.bytebuddy.description.method.MethodDescription.AbstractBase, net.bytebuddy.description.type.TypeDescription.AbstractBase

An abstract base implementation of a type variable source.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public TypeDescription.Generic
findExpectedVariable(String
The symbolic name of the type variable.
symbol
)

Implements net.bytebuddy.description.TypeVariableSource.findExpectedVariable.

Finds a particular variable with the given name in the closes type variable source that is visible from this instance.
public TypeDescription.Generic
findVariable(String
The symbolic name of the type variable.
symbol
)

Implements net.bytebuddy.description.TypeVariableSource.findVariable.

Finds a particular variable with the given name in the closes type variable source that is visible from this instance.
protected abstract String

Returns:

A safe string representation.
toSafeString
()

Returns a Object#toString() representation that does not attempt to resolve any type variables to avoid stack overflow exceptions.

Inherited from net.bytebuddy.description.ModifierReviewable.AbstractBase:
getEnumerationStategetFieldManifestationgetFieldPersistencegetMethodManifestationgetMethodStrictnessgetOwnershipgetParameterManifestationgetProvisioningStategetSynchronizationStategetSyntheticStategetTypeManifestationgetVisibilityisAbstractisAnnotationisBridgeisDeprecatedisEnumisFinalisInterfaceisMandatedisNativeisPackagePrivateisPrivateisProtectedisPublicisStaticisStrictisSynchronizedisSyntheticisTransientisVarArgsisVolatile

Constructor Detail

AbstractBaseback to summary
public AbstractBase()

Method Detail

findExpectedVariableback to summary
public TypeDescription.Generic findExpectedVariable(String symbol)

Implements net.bytebuddy.description.TypeVariableSource.findExpectedVariable.

Doc from net.bytebuddy.description.TypeVariableSource.findExpectedVariable.

Finds a particular variable with the given name in the closes type variable source that is visible from this instance. If the variable is not found, an exception is thrown.

Parameters
symbol:String

The symbolic name of the type variable.

Returns:TypeDescription.Generic

The type variable.

findVariableback to summary
public TypeDescription.Generic findVariable(String symbol)

Implements net.bytebuddy.description.TypeVariableSource.findVariable.

Doc from net.bytebuddy.description.TypeVariableSource.findVariable.

Finds a particular variable with the given name in the closes type variable source that is visible from this instance.

Parameters
symbol:String

The symbolic name of the type variable.

Returns:TypeDescription.Generic

The type variable or null if it was not found.

Annotations
@MaybeNull
toSafeStringback to summary
protected abstract String toSafeString()

Returns a Object#toString() representation that does not attempt to resolve any type variables to avoid stack overflow exceptions.

Returns:String

A safe string representation.

net.bytebuddy.description back to summary

public Interface TypeVariableSource.Visitor<T>

Known Direct Implementers
net.bytebuddy.description.TypeVariableSource.Visitor.NoOp, net.bytebuddy.description.type.TypeDescription.Generic.Visitor.Substitutor.ForTypeVariableBinding.TypeVariableSubstitutor
Type Parameters
<T>
The visitor's return type.

A visitor that can be applied to a type variable source.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
TypeVariableSource.Visitor.NoOp

A none-operational implementation of a type variable visitor that simply returns the visited source.

Method Summary

Modifier and TypeMethod and Description
public T

Returns:

The visitor's return value.
onMethod
(MethodDescription.InDefinedShape
The method onto which this visitor is applied.
methodDescription
)

Applies the visitor on a method.

public T

Returns:

The visitor's return value.
onType
(TypeDescription
The type onto which this visitor is applied.
typeDescription
)

Applies the visitor on a type.

Method Detail

onMethodback to summary
public T onMethod(MethodDescription.InDefinedShape methodDescription)

Applies the visitor on a method.

Parameters
methodDescription:MethodDescription.InDefinedShape

The method onto which this visitor is applied.

Returns:T

The visitor's return value.

onTypeback to summary
public T onType(TypeDescription typeDescription)

Applies the visitor on a type.

Parameters
typeDescription:TypeDescription

The type onto which this visitor is applied.

Returns:T

The visitor's return value.

net.bytebuddy.description back to summary

public final Enum TypeVariableSource.Visitor.NoOp

extends Enum<TypeVariableSource.Visitor.NoOp>
implements TypeVariableSource.Visitor<TypeVariableSource>
Class Inheritance
All Implemented Interfaces
net.bytebuddy.description.TypeVariableSource.Visitor

A none-operational implementation of a type variable visitor that simply returns the visited source.

Field Summary

Modifier and TypeField and Description
public static final TypeVariableSource.Visitor.NoOp
INSTANCE

The singleton instance.

Constructor Summary

AccessConstructor and Description
private
NoOp()

Method Summary

Modifier and TypeMethod and Description
public TypeVariableSource
onMethod(MethodDescription.InDefinedShape
The method onto which this visitor is applied.
methodDescription
)

Implements net.bytebuddy.description.TypeVariableSource.Visitor.onMethod.

Applies the visitor on a method.
public TypeVariableSource
onType(TypeDescription
The type onto which this visitor is applied.
typeDescription
)

Implements net.bytebuddy.description.TypeVariableSource.Visitor.onType.

Applies the visitor on a type.
public static TypeVariableSource.Visitor.NoOp
public static TypeVariableSource.Visitor.NoOp[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

INSTANCEback to summary
public static final TypeVariableSource.Visitor.NoOp INSTANCE

The singleton instance.

Constructor Detail

NoOpback to summary
private NoOp()

Method Detail

onMethodback to summary
public TypeVariableSource onMethod(MethodDescription.InDefinedShape methodDescription)

Implements net.bytebuddy.description.TypeVariableSource.Visitor.onMethod.

Doc from net.bytebuddy.description.TypeVariableSource.Visitor.onMethod.

Applies the visitor on a method.

Parameters
methodDescription:MethodDescription.InDefinedShape

The method onto which this visitor is applied.

Returns:TypeVariableSource

The visitor's return value.

onTypeback to summary
public TypeVariableSource onType(TypeDescription typeDescription)

Implements net.bytebuddy.description.TypeVariableSource.Visitor.onType.

Doc from net.bytebuddy.description.TypeVariableSource.Visitor.onType.

Applies the visitor on a type.

Parameters
typeDescription:TypeDescription

The type onto which this visitor is applied.

Returns:TypeVariableSource

The visitor's return value.

valueOfback to summary
public static TypeVariableSource.Visitor.NoOp valueOf(String name)
valuesback to summary
public static TypeVariableSource.Visitor.NoOp[] values()