拷贝list对象

@param clazz      目标类型
@param src        原对象集合
@param biConsumer 回调函数
@param <T>        原数据类型
@param <R>        目标数据类型
@return 目标对象集合
330019
public static <T, R> List<R> processList(Class<R> clazz, List<T> src, BiConsumer<R, T> biConsumer) {
        if (!Lists.iterable(src)) {
            log.warn("the src argument must be not null, return empty list. ");
            return Lists.newArrayList();
        }
        return src.stream().map(e -> process(clazz, e, biConsumer)).collect(Collectors.toList());
    }
1058916
@NotNull
    public static <T> Collector<T, ?, List<T>> toList() {
        return new CollectorsImpl<T, List<T>, List<T>>(

                new Supplier<List<T>>() {
                    @NotNull
                    @Override
                    public List<T> get() {
                        return new ArrayList<T>();
                    }
                },

                new BiConsumer<List<T>, T>() {
                    @Override
                    public void accept(@NotNull List<T> t, T u) {
                        t.add(u);
                    }
                }
        );
    }
116145
public static List<String> readListResource(Class<?> clazz, String path)
    {
        File targetFile = resolve(clazz, path);
        if (targetFile == null)
        {
            return null;
        }

        List<String> result;
        try
        {
            result = FileUtils.readLines(targetFile, "UTF-8");
        }
        catch (IOException ex)
        {
            return null;
        }

        return result;
    }
831007
public static <T> Stream<T> findAll(Class<T> clazz) {
    ServiceLoader<T> load = ServiceLoader.load(clazz);
    return StreamSupport.stream(load.spliterator(), false);
  }
184125
public static List<Field> findFields(final Class<?> clazz) {
        List<Field> foundFields = new ArrayList<>();
        Class<?> searchType = clazz;
        while (!Object.class.equals(searchType) && (searchType != null)) {
            Field[] fields = searchType.getDeclaredFields();
            for (Field field : fields) {
                field.setAccessible(true);
                foundFields.add(field);
            }
            searchType = searchType.getSuperclass();
        }
        return foundFields;
    }
295959
@Beta
    public static <A, T> Consumer<T> sc(final Object mutex, final A a, final BiConsumer<A, T> biConsumer) {
        N.checkArgNotNull(mutex, "mutex");
        N.checkArgNotNull(biConsumer, "biConsumer");

        return new Consumer<T>() {
            @Override
            public void accept(T t) {
                synchronized (mutex) {
                    biConsumer.accept(a, t);
                }
            }
        };
    }
31416
public static <T> List<T> getList(Class<T> clazz, String sql, Object... arg) {

        Connection connection = JDBCUtils.getConnection();
        List<T> list = null;// 存放返回的集合对象
        // 存放所有获取的记录的Map对象
        List<Map<String, Object>> listProperties = new ArrayList<Map<String, Object>>();

        PreparedStatement ps = null;
        ResultSet result = null;

        // 填充占位符

        try {
            ps = connection.prepareStatement(sql);
            for (int i = 0; i < arg.length; i++) {
                ps.setObject(i + 1, arg[i]);
            }

            // 执行SQL语句
            result = ps.executeQuery();

            // 获取结果集中所有记录
            listProperties = handleResultSetToMapList(result, listProperties);

            // 获取每条记录中相应的对象
            list = DBUtils.transformMapListToBeanList(clazz, listProperties);
        } catch (SQLException e) {
            e.printStackTrace();
        } catch (InstantiationException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        } catch (InvocationTargetException e) {
            e.printStackTrace();
        } finally {
            JDBCUtils.release(result, ps, connection);
        }

        return list;
    }
1369334
public static Map<String, Type> getReflectiveMappingTypes(Class<? extends MailChimpObject> clazz) {
		Map<String, Type> types = reflectiveMappingsTypes.get(clazz);

		if (types == null) {
			types = new LinkedHashMap<String, Type>();

			for(Map.Entry<String, java.lang.reflect.Field> entry: getReflectiveMapping(clazz).entrySet()) {
				types.put(entry.getKey(), entry.getValue().getGenericType());
			}

			reflectiveMappingsTypes.put(clazz, Collections.unmodifiableMap(types));
		}

		return types;
	}
857589
public static <T> List<T> getNullableList(final Map map, final Class<T> clazz, final Object... path) {
        return (List<T>) getNullable(map, List.class, path);
    }
853490
@Nonnull
	public static <T1, T2> LBiConsumer<T1, T2> biConsumerFrom(Consumer<LBiConsumerBuilder<T1, T2>> buildingFunction) {
		LBiConsumerBuilder builder = new LBiConsumerBuilder();
		buildingFunction.accept(builder);
		return builder.build();
	}
1066163
public <T extends ValueMap> List<T> getList(Object key, Class<T> clazz) {
    Object value = get(key);
    if (value instanceof List) {
      List list = (List) value;
      try {
        ArrayList<T> real = new ArrayList<>();
        for (Object item : list) {
          T typedValue = coerceToValueMap(item, clazz);
          if (typedValue != null) {
            real.add(typedValue);
          }
        }
        return real;
      } catch (Exception ignored) {
      }
    }
    return null;
  }
240244
public static List<Method> getAllMethod(Class<?> clazz) {
        return ALL_METHOD_CACHE.compute(clazz, (key, value) -> {
            if (value == null) {
                List<Method> methods = new ArrayList<>();
                Map<String, Method> methodMap = getAllMethod(key, new HashMap<>());

                methodMap.forEach((k, v) -> methods.add(v));
                return methods;
            } else {
                return value;
            }
        });
    }
918734
public static <T, U> Consumer<Pair<T, U>> tupled(BiConsumer<T, U> consumer) {
        dbc.precondition(consumer != null, "cannot apply a pair to a null consumer");
        return pair -> consumer.accept(pair.first(), pair.second());
    }
1259179
public java.util.List<? extends com.google.bigtable.v2.ReadRowsResponse.CellChunkOrBuilder>
      getChunksOrBuilderList() {
    return chunks_;
  }
1107844
@SuppressWarnings("unchecked")
    public static Collection<Object> getCollectionObj(Class<?> clazz) {
        if (clazz.isInterface()) {
            if (clazz.isAssignableFrom(List.class))
                return new ArrayList<>();
            else if (clazz.isAssignableFrom(Set.class))
                return new HashSet<>();
            else if (clazz.isAssignableFrom(Queue.class))
                return new ArrayDeque<>();
            else if (clazz.isAssignableFrom(SortedSet.class))
                return new TreeSet<>();
            else if (clazz.isAssignableFrom(BlockingQueue.class))
                return new LinkedBlockingDeque<>();
            else
                return null;
        } else {
            Collection<Object> collection = null;
            try {
                collection = (Collection<Object>) clazz.newInstance();
            } catch (Exception e) {
                System.err.println("new collection instance exception, " + e.getMessage());
            }
            return collection;
        }
    }
175886
@Nonnull
	public static <T1, T2> LBiConsumerBuilder<T1, T2> biConsumer(Consumer<LBiConsumer<T1, T2>> consumer) {
		return new LBiConsumerBuilder(consumer);
	}
1011189
@Nonnull
  public <T> List<T> toObjects(@Nonnull Class<T> clazz) {
    List<T> results = new ArrayList<>();

    for (DocumentSnapshot documentSnapshot : getDocuments()) {
      results.add(CustomClassMapper.convertToCustomClass(documentSnapshot.getData(), clazz));
    }

    return results;
  }