public final class InstanceUtil extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static Map<String,Class<?>> |
clazzMap |
protected static org.apache.logging.log4j.Logger |
logger |
static Map<String,com.esotericsoftware.reflectasm.MethodAccess> |
methodMap |
| 限定符和类型 | 方法和说明 |
|---|---|
static Class<?> |
getClass(String clazz)
Return the specified class.
|
static <T> T |
getDiff(T oldBean,
T newBean) |
static <E> List<E> |
getInstanceList(Class<E> cls,
List<?> list)
封装实体
|
static <E> List<E> |
getInstanceList(Class<E> cls,
ResultSet rs)
封装实体
|
static Object |
invokeMethod(Object owner,
String methodName,
Object... args)
执行某对象方法
|
static <E> ArrayList<E> |
newArrayList()
Constructs an empty ArrayList.
|
static <E> ArrayList<E> |
newArrayList(E... e)
Constructs an empty ArrayList.
|
static <k,v> ConcurrentHashMap<k,v> |
newConcurrentHashMap()
Constructs an empty ConcurrentHashMap.
|
static <k,v> HashMap<k,v> |
newHashMap()
Constructs an empty HashMap.
|
static <k,v> HashMap<k,v> |
newHashMap(k key,
v value)
Constructs an HashMap.
|
static <E> HashSet<E> |
newHashSet()
Constructs an empty HashSet.
|
static <k,v> Hashtable<k,v> |
newHashtable()
Constructs an empty Hashtable.
|
static <E> E |
newInstance(Class<E> cls,
Map<String,?> map)
新建实例
|
static <K> K |
newInstance(Class<K> cls,
Object... args) |
static Object |
newInstance(String clazz)
Return a new instance of the given class.
|
static Object |
newInstance(String className,
Object... args)
新建实例
|
static <k,v> LinkedHashMap<k,v> |
newLinkedHashMap()
Constructs an empty LinkedHashMap.
|
static <k,v> LinkedHashMap<k,v> |
newLinkedHashMap(k key,
v value)
Constructs an LinkedHashMap.
|
static <E> LinkedHashSet<E> |
newLinkedHashSet()
Constructs an empty LinkedHashSet.
|
static <E> LinkedList<E> |
newLinkedList()
Constructs an empty LinkedList.
|
static <k,v> TreeMap<k,v> |
newTreeMap()
Constructs an empty TreeMap.
|
static <E> TreeSet<E> |
newTreeSet()
Constructs an empty TreeSet.
|
static <E> Vector<E> |
newVector()
Constructs an empty Vector.
|
static <k,v> WeakHashMap<k,v> |
newWeakHashMap()
Constructs an empty WeakHashMap.
|
static <T> T |
parse(String json,
Class<T> clazz) |
static <T> T |
to(Object orig,
Class<T> clazz)
实例化并复制属性
|
static Map<String,Object> |
transBean2Map(Object obj) |
static <T> T |
transMap2Bean(Map<String,Object> map,
Class<T> clazz) |
public static <T> T getDiff(T oldBean,
T newBean)
oldBean - newBean - public static final Class<?> getClass(String clazz)
Class.forName( claz ) (which only calls the System class
loader) when the class might be in a different classloader (e.g. in a
webapp).clazz - the name of the class to instantiatepublic static final <E> List<E> getInstanceList(Class<E> cls, List<?> list)
cls - 实体类list - 实体Map集合public static final <E> List<E> getInstanceList(Class<E> cls, ResultSet rs)
cls - 实体类list - 数据查询结果集public static final <E> E newInstance(Class<E> cls, Map<String,?> map)
cls - 实体类list - 实体属性Mappublic static final Object newInstance(String clazz)
Class.forName( claz ).newInstance() (which only
calls the System class loader) when the class might be in a different
classloader (e.g. in a webapp).clazz - the name of the class to instantiatepublic static final Object newInstance(String className, Object... args)
className - 类名args - 构造函数的参数public static final Object invokeMethod(Object owner, String methodName, Object... args)
owner - 对象methodName - 方法名args - 参数public static final <E> ArrayList<E> newArrayList()
public static final <E> ArrayList<E> newArrayList(E... e)
public static final <k,v> HashMap<k,v> newHashMap()
public static final <E> HashSet<E> newHashSet()
public static final <k,v> Hashtable<k,v> newHashtable()
public static final <k,v> LinkedHashMap<k,v> newLinkedHashMap()
public static final <E> LinkedHashSet<E> newLinkedHashSet()
public static final <E> LinkedList<E> newLinkedList()
public static final <k,v> TreeMap<k,v> newTreeMap()
public static final <E> TreeSet<E> newTreeSet()
public static final <E> Vector<E> newVector()
public static final <k,v> WeakHashMap<k,v> newWeakHashMap()
public static final <k,v> HashMap<k,v> newHashMap(k key, v value)
public static final <k,v> LinkedHashMap<k,v> newLinkedHashMap(k key, v value)
public static final <k,v> ConcurrentHashMap<k,v> newConcurrentHashMap()
Copyright © 2017. All rights reserved.