Package dev.runabout
Class MethodResolverBuilder
- java.lang.Object
-
- dev.runabout.MethodResolverBuilder
-
public class MethodResolverBuilder extends java.lang.ObjectA builder for the default implementation ofMethodResolver. The default implementation will use aStackWalkerto determine the first non-anonymous, non-lambda method that is not in theRunaboutServicepackage. This builder provides ways to further filter the stack frames, so that the correct method is determined.
-
-
Constructor Summary
Constructors Constructor Description MethodResolverBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MethodResolverbuild()MethodResolverBuildersetCallerClassBlacklist(java.util.Set<java.lang.Class<?>> callerClassBlacklist)Sets the caller class blacklist for the MethodResolver.MethodResolverBuildersetStackFramePredicate(java.util.function.Predicate<java.lang.StackWalker.StackFrame> stackFramePredicate)Sets the stack frame predicate for the MethodResolver.
-
-
-
Method Detail
-
setCallerClassBlacklist
public MethodResolverBuilder setCallerClassBlacklist(java.util.Set<java.lang.Class<?>> callerClassBlacklist)
Sets the caller class blacklist for the MethodResolver. If provided, the blacklist will be used to filter out classes when determining the caller in the MethodResolver. A check for the existence in this set will be used in conjunction with the stack frame predicate.- Parameters:
callerClassBlacklist- Set of classes to avoid when resolving the method.- Returns:
- The MethodResolverBuilder.
-
setStackFramePredicate
public MethodResolverBuilder setStackFramePredicate(java.util.function.Predicate<java.lang.StackWalker.StackFrame> stackFramePredicate)
Sets the stack frame predicate for the MethodResolver. If provided, the predicate must only return true for a stack frames that should be considered when determining the method the scenario is being built over. The first stack frame to pass the predicate will be used.- Parameters:
stackFramePredicate- The stack frame predicate.- Returns:
- The MethodResolverBuilder.
-
build
public MethodResolver build()
-
-