Package com.github.dactiv.common.bundle

Examples of com.github.dactiv.common.bundle.BeanResourceBundle


    user.setUsername("maurice");
   
    Map<String, Object> map = Maps.newHashMap();
   
    //测试include属性
    map = MapUtils.toMap(new BeanResourceBundle(user,new String[]{"username","password","realname"}));
   
    assertEquals(map.size(), 3);
    assertEquals(map.get("username"), user.getUsername());
    assertEquals(map.get("realname"), user.getRealname());
    assertEquals(map.get("password"), user.getPassword());
   
    assertFalse(map.containsKey("email"));
   
    //测试exclude属性
    map = MapUtils.toMap(new BeanResourceBundle(user,null,new String[]{"username","password","realname"}));
   
    assertEquals(map.size(), 2);
    assertEquals(map.get("id"), user.getId());
    assertEquals(map.get("state"),user.getState());
   
    assertFalse(map.containsKey("email"));
   
    //测试ignoreEmptyValue属性
    map = MapUtils.toMap(new BeanResourceBundle(user,null,null,false));

    assertEquals(map.get("id"), user.getId());
    assertEquals(map.get("state"),user.getState());
    assertEquals(map.get("username"), user.getUsername());
    assertEquals(map.get("realname"), user.getRealname());
View Full Code Here


    entity.setEmail(email);
   
    accountManager.updateUser(entity);
    SystemVariableUtils.getSessionVariable().setUser(entity);
   
    return MapUtils.toMap(new BeanResourceBundle(entity,new String[]{"realname"}));
  }
View Full Code Here

TOP

Related Classes of com.github.dactiv.common.bundle.BeanResourceBundle

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.