Class Api
- java.lang.Object
-
- com.google.errorprone.bugpatterns.checkreturnvalue.Api
-
-
Constructor Summary
Constructors Constructor Description Api()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract String
className()
Returns the fully qualified type that contains the given method/constructor.static Api
fromSymbol(com.sun.tools.javac.code.Symbol.MethodSymbol symbol, VisitorState state)
Returns theApi
representation of the givensymbol
.abstract String
methodName()
Returns the simple name of the method.abstract com.google.common.collect.ImmutableList<String>
parameterTypes()
Returns the list of fully qualified parameter types for the given method/constructor.static Api
parse(String api)
Parses an API string into anApi
.String
toString()
-
-
-
Method Detail
-
fromSymbol
public static Api fromSymbol(com.sun.tools.javac.code.Symbol.MethodSymbol symbol, VisitorState state)
Returns theApi
representation of the givensymbol
.
-
className
public abstract String className()
Returns the fully qualified type that contains the given method/constructor.
-
methodName
public abstract String methodName()
Returns the simple name of the method. If the API is a constructor (i.e.,isConstructor() == true
), then"<init>"
is returned.
-
parameterTypes
public abstract com.google.common.collect.ImmutableList<String> parameterTypes()
Returns the list of fully qualified parameter types for the given method/constructor.
-
parse
public static Api parse(String api)
Parses an API string into anApi
. Example API strings are:- a constructor (e.g.,
java.net.URI#<init>(java.lang.String)
) - a static method (e.g.,
java.net.URI#create(java.lang.String)
) - an instance method (e.g.,
java.util.List#get(int)
) - an instance method with types erased (e.g.,
java.util.List#add(java.lang.Object)
)
- a constructor (e.g.,
-
-