public class MethodInfo extends Object implements Comparable<MethodInfo>
Constructor and Description |
---|
MethodInfo(Set<ClassTypeInfo> ownerTypes,
String name,
MethodKind kind,
TypeInfo returnType,
Text returnDescription,
boolean fluent,
boolean cacheReturn,
List<ParamInfo> params,
String comment,
Doc doc,
boolean staticMethod,
boolean defaultMethod,
List<TypeParamInfo.Method> typeParams) |
Modifier and Type | Method and Description |
---|---|
void |
collectImports(Collection<ClassTypeInfo> imports) |
int |
compareTo(MethodInfo o) |
String |
getComment() |
Doc |
getDoc() |
MethodKind |
getKind() |
String |
getName() |
String |
getName(Case _case) |
Set<ClassTypeInfo> |
getOwnerTypes() |
ParamInfo |
getParam(int index) |
List<ParamInfo> |
getParams() |
Text |
getReturnDescription() |
TypeInfo |
getReturnType() |
Signature |
getSignature()
Returns the method signature, the returned object is freely modifiable.
|
List<TypeParamInfo.Method> |
getTypeParams() |
boolean |
isCacheReturn() |
boolean |
isDefaultMethod() |
boolean |
isFluent() |
boolean |
isNullableReturn() |
boolean |
isOwnedBy(ClassTypeInfo owner)
Return true if the provided type is the sole owner of this method, i.e this method
is only declared by the provided type.
|
boolean |
isStaticMethod() |
void |
mergeTypeParams(List<TypeParamInfo.Method> mergedTypeParams) |
ParamInfo |
resolveClassTypeParam(TypeVariableInfo typeVar)
Resolve the method parameter that is of kind
ClassKind.CLASS_TYPE and that matches the specified type variable e.g:<U> Map.Entry<String, U> getEntry(String s, Class<U> type);
returns for <U> the second method parameter. |
TypeArgExpression |
resolveTypeArg(TypeVariableInfo typeVar) |
String |
toString() |
public MethodInfo(Set<ClassTypeInfo> ownerTypes, String name, MethodKind kind, TypeInfo returnType, Text returnDescription, boolean fluent, boolean cacheReturn, List<ParamInfo> params, String comment, Doc doc, boolean staticMethod, boolean defaultMethod, List<TypeParamInfo.Method> typeParams)
public String getName()
public MethodKind getKind()
public TypeInfo getReturnType()
public ParamInfo resolveClassTypeParam(TypeVariableInfo typeVar)
ClassKind.CLASS_TYPE
and that matches the specified type variable e.g:<U> Map.Entry<String, U> getEntry(String s, Class<U> type);
<U>
the second method parameter.typeVar
- the type variable to checkpublic TypeArgExpression resolveTypeArg(TypeVariableInfo typeVar)
public Text getReturnDescription()
public Set<ClassTypeInfo> getOwnerTypes()
public Signature getSignature()
public boolean isOwnedBy(ClassTypeInfo owner)
owner
- the tested typeowner
argumentpublic boolean isFluent()
public boolean isCacheReturn()
public boolean isNullableReturn()
public ParamInfo getParam(int index)
public String getComment()
public Doc getDoc()
public boolean isStaticMethod()
public boolean isDefaultMethod()
public List<TypeParamInfo.Method> getTypeParams()
public void mergeTypeParams(List<TypeParamInfo.Method> mergedTypeParams) throws IllegalArgumentException
IllegalArgumentException
public void collectImports(Collection<ClassTypeInfo> imports)
public int compareTo(MethodInfo o)
compareTo
in interface Comparable<MethodInfo>
Copyright © 2017. All rights reserved.