public static <T> List<T> filterBy( final Iterable<T> array, Object object ) { List<T> list = new ArrayList<>( ); for ( T v : array ) { if ( Invoker.invokeBooleanReturn(object, v) ) { list.add( v ); } } return list; }
public static <T> List<T> filterBy( final Iterable<T> array, Object object, String methodName ) { List<T> list = new ArrayList<>( ); for ( T v : array ) { if ( (boolean) Invoker.invokeEither(object, methodName, v) ) { list.add( v ); } } return list; }
return invokeOverloadedFromList(respectIgnore, view, ignoreProperties, object, name, Lists.list(args)); } else if (args instanceof List) { List list = (List) args; return invokeOverloadedFromList(respectIgnore, view, ignoreProperties, object, name, list); return invokeOverloadedFromList(respectIgnore, view, ignoreProperties, object, name, Lists.list(args)); return invokeOverloadedFromList(respectIgnore, view, ignoreProperties, object, name, list); return invoke(object, name); } else { return invokeOverloadedFromList(respectIgnore, view, ignoreProperties, object, name, Lists.list(args));
return invokeFromList(respectIgnore, view, ignoreProperties, cls, object, name, Lists.list(args)); } else if (args instanceof List) { List list = (List) args; return invokeFromList(respectIgnore, view, ignoreProperties, cls, object, name, list); switch (type) { case INSTANCE: return invokeFromList(respectIgnore, view, ignoreProperties, cls, object, name, Lists.list(args)); return invokeFromList(respectIgnore, view, ignoreProperties, cls, object, name, list); return invokeFromList(respectIgnore, view, ignoreProperties, cls, object, name, list); return invoke(object, name); } else { return invokeFromList(respectIgnore, view, ignoreProperties, cls, object, name, Lists.list(args));
public static List<?> mapBy(Iterable<?> objects, Object function) { MethodAccess methodAccess = Invoker.invokeFunctionMethodAccess(function); List list = new ArrayList(); for (Object o : objects) { list.add( methodAccess.invoke(function, o)); } return list; }
public static Object invokeFromObject(Object object, String name, Object args) { return invokeFromObject(false, null, null, object, name, args); }
public static Object invokeFromList(Object object, String name, List<?> args) { return invokeFromList(true, null, null, object, name, args); }
public static List<?> mapBy(Collection<?> objects, Class<?> cls, String methodName) { List list = new ArrayList(objects.size()); MethodAccess methodAccess = Invoker.invokeMethodAccess(cls, methodName); for (Object o : objects) { list.add( methodAccess.invokeStatic(o)); } return list; }
public static Object invokeMethodFromList(boolean respectIgnore, String view, Set<String> ignoreProperties, Object object, MethodAccess method, List<?> argsList) { try { if (argsList == null && method.parameterTypes().length == 0) { return method.invoke(object); } else { Object [] finalArgs = convertArguments(respectIgnore, view, ignoreProperties, object, argsList, method ); return method.invoke(object, finalArgs); } }catch (Exception ex) { return Exceptions.handle(Object.class, ex, "Unable to invoke method object", object, "method", method, "args", argsList); } }
/** * Invokes method from list or map depending on what the Object arg is. * @param object object * @param method method * @param args args * @return result */ public static Object invokeMethodFromObjectArg(Object object, MethodAccess method, Object args) { return invokeMethodFromObjectArg(false, null, null, object, method, args); }
return invokeMethodFromList(respectIgnore, view, ignoreProperties, object, method, Lists.list(args)); } else if (args instanceof List) { List list = (List) args; return invokeMethodFromList(respectIgnore, view, ignoreProperties, object, method, list); !Typ.isCollection(firstParamType) && !firstParamType.isArray()) { return invokeMethodFromList(respectIgnore, view, ignoreProperties, object, method, list); return invokeMethodFromList(respectIgnore, view, ignoreProperties, object, method, Lists.list(args)); return invokeMethodFromList(respectIgnore, view, ignoreProperties, object, method, list); return method.invoke(object); } else { return invokeMethodFromList(respectIgnore, view, ignoreProperties, object, method, Lists.list(args));
return invokeOverloadedFromList(respectIgnore, view, ignoreProperties, object, name, Lists.list(args)); } else if (args instanceof List) { List list = (List) args; return invokeOverloadedFromList(respectIgnore, view, ignoreProperties, object, name, list); return invokeOverloadedFromList(respectIgnore, view, ignoreProperties, object, name, Lists.list(args)); return invokeOverloadedFromList(respectIgnore, view, ignoreProperties, object, name, list); return invoke(object, name); } else { return invokeOverloadedFromList(respectIgnore, view, ignoreProperties, object, name, Lists.list(args));
return invokeFromList(respectIgnore, view, ignoreProperties, cls, object, name, Lists.list(args)); } else if (args instanceof List) { List list = (List) args; return invokeFromList(respectIgnore, view, ignoreProperties, cls, object, name, list); switch (type) { case INSTANCE: return invokeFromList(respectIgnore, view, ignoreProperties, cls, object, name, Lists.list(args)); return invokeFromList(respectIgnore, view, ignoreProperties, cls, object, name, list); return invokeFromList(respectIgnore, view, ignoreProperties, cls, object, name, list); return invoke(object, name); } else { return invokeFromList(respectIgnore, view, ignoreProperties, cls, object, name, Lists.list(args));
public static List<?> mapBy(Collection<?> objects, Object function) { MethodAccess methodAccess = Invoker.invokeFunctionMethodAccess(function); List list = new ArrayList(); for (Object o : objects) { list.add( methodAccess.invoke(function, o)); } return list; }
public static Object invokeFromObject(Class<?> cls, String name, Object args) { return invokeFromObject(false, null, null, cls, null, name, args); }
public static Object invokeFromList(Class<?> cls, String name, List<?> args) { return invokeFromList(true, null, null, cls, null, name, args); }
public static List<?> mapBy(Collection<?> objects, Object object, String methodName) { MethodAccess methodAccess = Invoker.invokeMethodAccess(object.getClass(), methodName); List list = new ArrayList(objects.size()); for (Object o : objects) { list.add( methodAccess.invoke(object, o)); } return list; }
public static Object invokeMethodFromList(boolean respectIgnore, String view, Set<String> ignoreProperties, Object object, MethodAccess method, List<?> argsList) { try { if (argsList == null && method.parameterTypes().length == 0) { return method.invoke(object); } else { Object [] finalArgs = convertArguments(respectIgnore, view, ignoreProperties, object, argsList, method ); return method.invoke(object, finalArgs); } }catch (Exception ex) { return Exceptions.handle(Object.class, ex, "Unable to invoke method object", object, "method", method, "args", argsList); } }
/** * Invokes method from list or map depending on what the Object arg is. * @param object object * @param method method * @param args args * @return result */ public static Object invokeMethodFromObjectArg(Object object, MethodAccess method, Object args) { return invokeMethodFromObjectArg(false, null, null, object, method, args); }