edu.umd.cs.findbugs.ba.generic
public class GenericObjectType extends ObjectType
A GenericObjectType is either a parameterized type e.g.
List<String>
, or a type variable e.g.
T
.
This class cannot be initialized directly. Instead, create a GenericObjectType by calling GenericUtilities.getType(String) and passing in the bytecode signature for the type.
Method Summary | |
---|---|
Type | getExtension() |
int | getNumParameters() |
ObjectType | getObjectType() |
ReferenceType | getParameterAt(int index) |
List<? extends ReferenceType> | getParameters() |
GenericUtilities.TypeCategory | getTypeCategory()
Get the TypeCategory that represents this Object |
Type | getUpperBound() |
String | getVariable() |
boolean | hasParameters() |
String | toString(boolean includeGenerics)
Return a string representation of this object.
|
Returns: Returns the extension.
Returns: the number of parameters if this is a parameterized class, 0 otherwise
Returns: the underlying ObjectType for this Generic Object
Parameters: index should be less than getNumParameters()
Returns: the type parameter at index
See Also: TypeCategory
Returns: Returns the variable.
Returns: true if this GenericObjectType represents a parameterized type e.g.
List<String>
. This implies that isVariable() is falses
toString()
in case
any existing code assumes that this object is an
ObjectType and expects similar string representation.
i.e. toString()
is equivalent to
toString(false)
)
Parameters: includeGenerics if true then the string includes generic information in this object. Otherwise this returns the same value as ObjectType.toString()