private static Method findCreatePojoMethod(Class<?> builderClass) { for (Method m : builderClass.getDeclaredMethods()) if (isAll(m, NOT_STATIC) && hasName(m, "build") && ! hasReturnType(m, Void.class)) return m; return null; } }
private static Method findCreatePojoMethod(Class<?> builderClass) { for (Method m : builderClass.getDeclaredMethods()) if (isAll(m, NOT_STATIC) && hasName(m, "build") && ! hasReturnType(m, Void.class)) return m; return null; } }
private static Method findBuilderCreateMethod(Class<?> pojoClass) { for (Method m : pojoClass.getDeclaredMethods()) if (isAll(m, PUBLIC, STATIC) && hasName(m, "create") && ! hasReturnType(m, Void.class)) return m; return null; }
private static Method findBuilderCreateMethod(Class<?> pojoClass) { for (Method m : pojoClass.getDeclaredMethods()) if (isAll(m, PUBLIC, STATIC) && hasName(m, "create") && ! hasReturnType(m, Void.class)) return m; return null; }
private static Method findBuilderCreateMethod(Class<?> pojoClass) { for (Method m : pojoClass.getDeclaredMethods()) if (isAll(m, PUBLIC, STATIC) && hasName(m, "create") && ! hasReturnType(m, Void.class)) return m; return null; }
private static Method findCreatePojoMethod(Class<?> builderClass) { for (Method m : builderClass.getDeclaredMethods()) if (isAll(m, NOT_STATIC) && hasName(m, "build") && ! hasReturnType(m, Void.class)) return m; return null; } }
/** * Find the public static creator method on the specified class. * * @param oc The created type. * @param ic The argument type. * @param name The method name. * @return The static method, or <jk>null</jk> if it couldn't be found. */ public static Method findPublicStaticCreateMethod(Class<?> oc, Class<?> ic, String name) { for (Method m : oc.getMethods()) if (isAll(m, STATIC, PUBLIC, NOT_DEPRECATED) && hasName(m, name) && hasReturnType(m, oc) && hasArgs(m, ic)) return m; return null; }
/** * Find the public static creator method on the specified class. * * @param oc The created type. * @param ic The argument type. * @param name The method name. * @return The static method, or <jk>null</jk> if it couldn't be found. */ public static Method findPublicStaticCreateMethod(Class<?> oc, Class<?> ic, String name) { for (Method m : oc.getMethods()) if (isAll(m, STATIC, PUBLIC, NOT_DEPRECATED) && hasName(m, name) && hasReturnType(m, oc) && hasArgs(m, ic)) return m; return null; }
/** * Find the public static creator method on the specified class. * * @param oc The created type. * @param ic The argument type. * @param name The method name. * @return The static method, or <jk>null</jk> if it couldn't be found. */ public static Method findPublicStaticCreateMethod(Class<?> oc, Class<?> ic, String name) { for (Method m : oc.getMethods()) if (isAll(m, STATIC, PUBLIC, NOT_DEPRECATED) && hasName(m, name) && hasReturnType(m, oc) && hasArgs(m, ic)) return m; return null; }
/** * Finds the public static "fromString" method on the specified class. * * <p> * Looks for the following method names: * <ul> * <li><code>fromString</code> * <li><code>fromValue</code> * <li><code>valueOf</code> * <li><code>parse</code> * <li><code>parseString</code> * <li><code>forName</code> * <li><code>forString</code> * </ul> * * @param c The class to find the method on. * @return The static method, or <jk>null</jk> if it couldn't be found. */ public static Method findPublicFromStringMethod(Class<?> c) { for (String methodName : new String[]{"create","fromString","fromValue","valueOf","parse","parseString","forName","forString"}) for (Method m : c.getMethods()) if (isAll(m, STATIC, PUBLIC, NOT_DEPRECATED) && hasName(m, methodName) && hasReturnType(m, c) && hasArgs(m, String.class)) return m; return null; }
/** * Finds the public static "fromString" method on the specified class. * * <p> * Looks for the following method names: * <ul> * <li><code>fromString</code> * <li><code>fromValue</code> * <li><code>valueOf</code> * <li><code>parse</code> * <li><code>parseString</code> * <li><code>forName</code> * <li><code>forString</code> * </ul> * * @param c The class to find the method on. * @return The static method, or <jk>null</jk> if it couldn't be found. */ public static Method findPublicFromStringMethod(Class<?> c) { for (String methodName : new String[]{"create","fromString","fromValue","valueOf","parse","parseString","forName","forString"}) for (Method m : c.getMethods()) if (isAll(m, STATIC, PUBLIC, NOT_DEPRECATED) && hasName(m, methodName) && hasReturnType(m, c) && hasArgs(m, String.class)) return m; return null; }
/** * Finds the public static "fromString" method on the specified class. * * <p> * Looks for the following method names: * <ul> * <li><code>fromString</code> * <li><code>fromValue</code> * <li><code>valueOf</code> * <li><code>parse</code> * <li><code>parseString</code> * <li><code>forName</code> * <li><code>forString</code> * </ul> * * @param c The class to find the method on. * @return The static method, or <jk>null</jk> if it couldn't be found. */ public static Method findPublicFromStringMethod(Class<?> c) { for (String methodName : new String[]{"create","fromString","fromValue","valueOf","parse","parseString","forName","forString"}) for (Method m : c.getMethods()) if (isAll(m, STATIC, PUBLIC, NOT_DEPRECATED) && hasName(m, methodName) && hasReturnType(m, c) && hasArgs(m, String.class)) return m; return null; }
if (isAll(m2, PUBLIC, NOT_STATIC, HAS_NO_ARGS, NOT_DEPRECATED) && m2.getName().startsWith("to") && m2.getReturnType() == oc) { final Method m3 = m2; t = new Transform<I,O>() {
if (isAll(m2, PUBLIC, NOT_STATIC, HAS_NO_ARGS, NOT_DEPRECATED) && m2.getName().startsWith("to") && m2.getReturnType() == oc) { final Method m3 = m2; t = new Transform<I,O>() {
if (isAll(m2, PUBLIC, NOT_STATIC, HAS_NO_ARGS, NOT_DEPRECATED) && m2.getName().startsWith("to") && m2.getReturnType() == oc) { final Method m3 = m2; t = new Transform<I,O>() {