Class MethodFinder
- java.lang.Object
-
- org.inferred.freebuilder.processor.model.MethodFinder
-
public class MethodFinder extends java.lang.ObjectStatic utility method for finding all methods, declared and inherited, on a type.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceMethodFinder.ErrorTypeHandling<E extends java.lang.Exception>private static classMethodFinder.SignatureKey type.
-
Constructor Summary
Constructors Modifier Constructor Description privateMethodFinder()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static <E extends java.lang.Exception>
voidaddSupertypesToSet(javax.lang.model.element.TypeElement type, java.util.Set<javax.lang.model.element.TypeElement> mutableSet, MethodFinder.ErrorTypeHandling<E> errorTypeHandling)private static <E extends java.lang.Exception>
com.google.common.collect.ImmutableSet<javax.lang.model.element.TypeElement>getSupertypes(javax.lang.model.element.TypeElement type, MethodFinder.ErrorTypeHandling<E> errorTypeHandling)private static <E extends java.lang.Exception>
java.util.Optional<javax.lang.model.element.TypeElement>maybeTypeElement(javax.lang.model.type.TypeMirror mirror, MethodFinder.ErrorTypeHandling<E> errorTypeHandling)static <E extends java.lang.Exception>
com.google.common.collect.ImmutableSet<javax.lang.model.element.ExecutableElement>methodsOn(javax.lang.model.element.TypeElement type, javax.lang.model.util.Elements elements, MethodFinder.ErrorTypeHandling<E> errorTypeHandling)Returns all methods, declared and inherited, ontype, except those specified byObject.
-
-
-
Method Detail
-
methodsOn
public static <E extends java.lang.Exception> com.google.common.collect.ImmutableSet<javax.lang.model.element.ExecutableElement> methodsOn(javax.lang.model.element.TypeElement type, javax.lang.model.util.Elements elements, MethodFinder.ErrorTypeHandling<E> errorTypeHandling) throws E extends java.lang.ExceptionReturns all methods, declared and inherited, ontype, except those specified byObject.If method B overrides method A, only method B will be included in the return set. Additionally, if methods A and B have the same signature, but are on unrelated interfaces, one will be arbitrarily picked to be returned.
- Throws:
E extends java.lang.Exception
-
getSupertypes
private static <E extends java.lang.Exception> com.google.common.collect.ImmutableSet<javax.lang.model.element.TypeElement> getSupertypes(javax.lang.model.element.TypeElement type, MethodFinder.ErrorTypeHandling<E> errorTypeHandling) throws E extends java.lang.Exception- Throws:
E extends java.lang.Exception
-
addSupertypesToSet
private static <E extends java.lang.Exception> void addSupertypesToSet(javax.lang.model.element.TypeElement type, java.util.Set<javax.lang.model.element.TypeElement> mutableSet, MethodFinder.ErrorTypeHandling<E> errorTypeHandling) throws E extends java.lang.Exception- Throws:
E extends java.lang.Exception
-
maybeTypeElement
private static <E extends java.lang.Exception> java.util.Optional<javax.lang.model.element.TypeElement> maybeTypeElement(javax.lang.model.type.TypeMirror mirror, MethodFinder.ErrorTypeHandling<E> errorTypeHandling) throws E extends java.lang.Exception- Throws:
E extends java.lang.Exception
-
-