• List<String> 2List <Long>


     public static List<Integer> CollStringToIntegerLst(List<String> inList){
            List<Integer> iList =new ArrayList<Integer>(inList.size());
            CollectionUtils.collect(inList, 
                      new Transformer(){
                        public java.lang.Object transform(java.lang.Object input){
                          return new Integer((String)input);
                        }
                      } ,iList );
            return iList;
        }


    /**
    * 分页按条件查询权限列表
    *
    * @param keywords
    * @return
    */
    @RequestMapping(value = "/getByCondition2", method = { RequestMethod.GET,
    RequestMethod.POST })
    public @ResponseBody String getByCondition2(String beginTime,
    String endTime,String privilegePersonsList,int startRow,int pageSize) {
    List<Integer> privilegePersonLongs= new ArrayList<Integer>();
    String[] split = privilegePersonsList.split(",");
    List<String> privilegePersons= Arrays.asList(split);

    if (privilegePersonLongs!=null) {
    List<DataPrivilege> list =service.selectByCondition(beginTime,endTime, ListUtil.fromStringToLongList(privilegePersons),startRow,pageSize);
    Page<DataPrivilege> page = new Page<DataPrivilege>(service.countByConditions());
    if (list.size() != 0) {
    ResultVO<DataPrivilege> result = new ResultVO<DataPrivilege>();
    result.setLists(list);
    result.setPage(page);
    return result.toString();
    }
    }
    return "";
    }
     public static List<Integer> CollStringToIntegerLst(List<String> inList){
            List<Integer> iList =new ArrayList<Integer>(inList.size());
            CollectionUtils.collect(inList, 
                      new Transformer(){
                        public java.lang.Object transform(java.lang.Object input){
                          return new Integer((String)input);
                        }
                      } ,iList );
            return iList;
        }
  • 相关阅读:
    netlink(todo)
    【拓展】如何画好架构图
    【JS】527- 关于 JS 中的浮点计算
    【CSS】526- CSS 控制图标颜色
    【拓展】一个故事讲完CPU的工作原理
    【面试题】525- 阿里 P6 的面经
    【生活】你在第几楼?80后、90后扎心图鉴
    【JS】524- 三分钟迁移 Ant Design 4
    【Web技术】522- 设计体系的响应式设计
    【适配】521- 移动端开发各种兼容适配问题(屏幕、图像、字体与布局等)
  • 原文地址:https://www.cnblogs.com/alamps/p/6734557.html
Copyright © 2020-2023  润新知