Class MethodFinder
java.lang.Object
org.inferred.freebuilder.processor.model.MethodFinder
Static utility method for finding all methods, declared and inherited, on a type.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceMethodFinder.ErrorTypeHandling<E extends Exception>private static classKey type. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static <E extends Exception>
voidaddSupertypesToSet(TypeElement type, Set<TypeElement> mutableSet, MethodFinder.ErrorTypeHandling<E> errorTypeHandling) private static <E extends Exception>
com.google.common.collect.ImmutableSet<TypeElement> getSupertypes(TypeElement type, MethodFinder.ErrorTypeHandling<E> errorTypeHandling) private static <E extends Exception>
Optional<TypeElement> maybeTypeElement(TypeMirror mirror, MethodFinder.ErrorTypeHandling<E> errorTypeHandling) static <E extends Exception>
com.google.common.collect.ImmutableSet<ExecutableElement> methodsOn(TypeElement type, Elements elements, MethodFinder.ErrorTypeHandling<E> errorTypeHandling) Returns all methods, declared and inherited, ontype, except those specified byObject.
-
Constructor Details
-
MethodFinder
private MethodFinder()
-
-
Method Details
-
methodsOn
public static <E extends Exception> com.google.common.collect.ImmutableSet<ExecutableElement> methodsOn(TypeElement type, Elements elements, MethodFinder.ErrorTypeHandling<E> errorTypeHandling) throws E Returns 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
-
getSupertypes
private static <E extends Exception> com.google.common.collect.ImmutableSet<TypeElement> getSupertypes(TypeElement type, MethodFinder.ErrorTypeHandling<E> errorTypeHandling) throws E - Throws:
E
-
addSupertypesToSet
private static <E extends Exception> void addSupertypesToSet(TypeElement type, Set<TypeElement> mutableSet, MethodFinder.ErrorTypeHandling<E> errorTypeHandling) throws E - Throws:
E
-
maybeTypeElement
private static <E extends Exception> Optional<TypeElement> maybeTypeElement(TypeMirror mirror, MethodFinder.ErrorTypeHandling<E> errorTypeHandling) throws E - Throws:
E
-