合并两个相同对象的属性值,类似于js的extend方法(Merge the property values of two identical objects, similar to the extend method of JS).docVIP

  • 38
  • 0
  • 约7.59千字
  • 约 17页
  • 2017-10-05 发布于河南
  • 举报

合并两个相同对象的属性值,类似于js的extend方法(Merge the property values of two identical objects, similar to the extend method of JS).doc

合并两个相同对象的属性值,类似于js的extend方法(Merge the property values of two identical objects, similar to the extend method of JS)

合并两个相同对象的属性值,类似于js的extend方法(Merge the property values of two identical objects, similar to the extend method of JS) Merge the property values of two identical objects, similar to the extend method of JS Xiao Yao released on 2012, 04, 03, 1, 10 comments /677 read share to Sina, micro-blog, Tencent, micro-blog collection, +3 step top 0 Merge the property values of two identical objects, similar to the extend method of JS Tags: no code fragment (1) [Code] [Java] code View sourceprint? 001 / / help me Tidianyixian. 002 package cn.utils; 003 004 import java.beans.BeanInfo; 005 import java.beans.IntrospectionException; 006 import java.beans.Introspector; 007 import java.beans.PropertyDescriptor; 008 import java.lang.reflect.InvocationTargetException; 009 import java.sql.Timestamp; 010 import java.text.ParseException; 011 import java.text.SimpleDateFormat; 012 import java.util.ArrayList; 013 import java.util.Date; 014 import java.util.Iterator; 015 import java.util.List; 016 import java.util.Map; 017 import java.util.regex.Pattern; 018 019 import mons.beanutils.BeanUtils; 020 021 022, public, class, ExtendObject { 023 024 / * * 025 * merge the contents of the same type of objects to the right 026 * @param beanType returns the type of object 027 * @param initObject contains the object of the original data 028 * @param updateObject contains the object of the modified data 029 * @return returns the combination of two objects, the value of the same property, if it contains, and is not null, the value of it, otherwise the value of convertedObject is taken, or else the value of returnedObject is taken 030. 031 @SuppressWarnings (unchecked) 032, public, Object, extendObject (Object, beanType, Object, initObject, Object, updateObject) { 033 Map MAP1 = BeanToMap (initObject); 034 Map MAP2 = BeanToMap (updateObject); 035 List list = getMapKeySet (MAP1); 036 for (int i=0; ilist.size (); i++) { 037 Object map2Value = map2.get (list.get (I)); 038 if (null, =map2Value) { 039 map1.put

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档