private static InjectionPoint getFunctionCall(Parameter parameter, BiFunction biFunction) { if (biFunction.getClass().equals(BiFunctionGetter.class)) { Getter getter = ((BiFunctionGetter)biFunction).getGetter(); Class<?> getterClass = getter.getClass(); if (TypeHelper.isPrimitive(parameter.getType())) { Class<?> primitiveGetter = getPrimitiveGetter(parameter.getType()); if (primitiveGetter == null) { throw new IllegalStateException("No primitive getter for primitive " + parameter.getType()); } Type publicGetterClass = AsmUtils.findClosestPublicTypeExposing(getterClass, primitiveGetter); if (publicGetterClass != null) { return new InjectionPoint(parameter, biFunction, true, "get" + getPrimitiveMethodSuffix(parameter.getType()), publicGetterClass, true); } } Type publicGetterClass = AsmUtils.findClosestPublicTypeExposing(getterClass, Getter.class); return new InjectionPoint(parameter, biFunction, true, "get", publicGetterClass, false); } else { return new InjectionPoint(parameter, biFunction, false, "apply", biFunction.getClass(), false); } }
Method getterMethod = injectionPoint.getMethod();
Method getterMethod = injectionPoint.getMethod();
private static InjectionPoint getFunctionCall(Parameter parameter, BiFunction biFunction) { if (biFunction.getClass().equals(BiFunctionGetter.class)) { Getter getter = ((BiFunctionGetter)biFunction).getGetter(); Class<?> getterClass = getter.getClass(); if (TypeHelper.isPrimitive(parameter.getType())) { Class<?> primitiveGetter = getPrimitiveGetter(parameter.getType()); if (primitiveGetter == null) { throw new IllegalStateException("No primitive getter for primitive " + parameter.getType()); } Type publicGetterClass = AsmUtils.findClosestPublicTypeExposing(getterClass, primitiveGetter); if (publicGetterClass != null) { return new InjectionPoint(parameter, biFunction, true, "get" + getPrimitiveMethodSuffix(parameter.getType()), publicGetterClass, true); } } Type publicGetterClass = AsmUtils.findClosestPublicTypeExposing(getterClass, Getter.class); return new InjectionPoint(parameter, biFunction, true, "get", publicGetterClass, false); } else { return new InjectionPoint(parameter, biFunction, false, "apply", biFunction.getClass(), false); } }