public final class BeanConverts extends Object
| 构造器和说明 |
|---|
BeanConverts() |
| 限定符和类型 | 方法和说明 |
|---|---|
static <E> Object[] |
toArray(E bean,
String... fields)
将对象指定字段转为map
|
static <E> List<Object[]> |
toList(List<E> beans,
String... fields) |
static <T,E> List<T> |
toList(List<E> beans,
String field)
获取对象指定字段的值
|
static <K,V,E> Map<K,V> |
toMap(E bean,
String keyField,
String valueField)
指定对象字段keyField的值作为key,字段valueField的值作为value
|
static <K,E> Map<K,E> |
toMap(List<E> beans,
String keyField) |
static <K,V,E> Map<K,V> |
toMap(List<E> beans,
String keyField,
String valueField) |
public static <E> Object[] toArray(E bean, String... fields)
E - bean - fields - public static <T,E> List<T> toList(List<E> beans, String field)
T - E - beans - field - public static <K,V,E> Map<K,V> toMap(E bean, String keyField, String valueField)
bean - keyField - valueField - Copyright © 2023. All rights reserved.