private Flow<PlasticMethod> matchEventHandlerMethods(PlasticClass plasticClass) { return F.flow(plasticClass.getMethods()).filter(new Predicate<PlasticMethod>() { public boolean accept(PlasticMethod method) { return "getClientId".equalsIgnoreCase(method.getDescription().methodName); } }); } }
private Flow<PlasticMethod> matchAllMethodsNotOverriddenFromBaseClass(final PlasticClass plasticClass) { return F.flow(plasticClass.getMethods()).filter(new Predicate<PlasticMethod>() { public boolean accept(PlasticMethod method) { return !method.isOverride() && !lifecycleMethods.contains(method.getDescription()); } }); } }
private Flow<PlasticMethod> matchEventHandlerMethods(PlasticClass plasticClass) { return F.flow(plasticClass.getMethods()).filter(IS_EVENT_HANDLER); }
private Flow<PlasticMethod> findResetMethods(PlasticClass plasticClass) { return F.flow(plasticClass.getMethods()).filter(METHOD_MATCHER).each(METHOD_VALIDATOR); } }
private Flow<PlasticMethod> matchLifecycleMethods(PlasticClass plasticClass) { return F.flow(plasticClass.getMethods()).filter(MATCHER).each(VALIDATE); } }
private MethodHandle findDefaultMethodHandle(PlasticClass plasticClass, String parameterName) { final String methodName = "default" + parameterName; Predicate<PlasticMethod> predicate = new Predicate<PlasticMethod>() { public boolean accept(PlasticMethod method) { return method.getDescription().argumentTypes.length == 0 && method.getDescription().methodName.equalsIgnoreCase(methodName); } }; Flow<PlasticMethod> matches = F.flow(plasticClass.getMethods()).filter(predicate); // This will match exactly 0 or 1 (unless the user does something really silly) // methods, and if it matches, we know the name of the method. return matches.isEmpty() ? null : matches.first().getHandle(); }