1. XenForo 1.5.14 中文版——支持中文搜索!现已发布!查看详情
  2. Xenforo 爱好者讨论群:215909318 XenForo专区

新闻 feilong-core 1.10.1,让 Java 开发更简便的工具包 下载

本帖由 漂亮的石头2017-03-09 发布。版面名称:软件资讯

  1. 漂亮的石头

    漂亮的石头 版主 管理成员

    注册:
    2012-02-10
    帖子:
    487,979
    赞:
    47
    feilong-core 1.10.1 发布了,是一个让 Java 开发更简便的工具包,
    可以让你从大量重复的底层代码中脱身,提高工作效率; 让你的代码更简炼,易写、易读、易于维护;

    本次升级共有4处变更,具体参见 1.10.1 milestone

    1.10.1 文档地址: http://feilong-core.mydoc.io/

    1.特性


    • 添加 MapUtil.get(Map<K, V>, int) fix #595


    • 添加 List<O> collect(Iterable<I> inputBeanIterable,Class<O> outputListBeanType,String...includePropertyNames) method fix #559

      假设你有两个类, User,Customer

      此时你需要将 List<User> 转换成 List<Customer>

      List<User> list = toList( new User(23L, "张飞"), new User(24L, "关羽"), new User(25L, "刘备"));

      以前你需要如此这般写:

      List<Customer> customerList = new ArrayList<>(); for (User user : list){ Customer customer = new Customer();
      customer.setId(user.getId());
      customer.setName(user.getName());
      customerList.add(customer);
      }

      如果属性很多,书写代码很繁琐

      现在你可以这么写:

      List<Customer> customerList = CollectionsUtil.collect(list, Customer.class);

      一行代码搞定集合转换问题

      如果你只想转换id属性,你可以:

      List<Customer> customerList = CollectionsUtil.collect(list, Customer.class,"id");

    • 添加 IgnoreCaseEquator fix #597


    • 添加 BeanPredicateUtil.equalIgnoreCasePredicate(String,String) fix #598

      在list中查找 name是 zhangfei(忽视大小写) 的user

      List<User> list = toList( new User("zhangfei", 22), new User("zhangFei", 22), new User("Zhangfei", 22), new User((String) null, 22), new User("guanyu", 25), new User("liubei", 30)
      ); List<User> select = select(list, BeanPredicateUtil.<User> equalIgnoreCasePredicate("name", "zhangfei"));
    2.修改


    • none
    3.移除


    • none
    4.Bug 修复


    • change CollectionsUtil.collect method, 如果入参是null,那么返回null fix #601
    feilong-core 1.10.1,让 Java 开发更简便的工具包下载地址
     
正在加载...