随笔分类 -  Java

摘要:package com.lbdz.common.utils; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.regex.Mat 阅读全文
posted @ 2024-12-10 11:37 一隅桥畔 阅读(13) 评论(0) 推荐(0) 编辑
摘要://字符串集合 BigDecimal sum = strList.stream().map(BigDecimal::new).reduce(BigDecimal.ZERO, BigDecimal::add); //对象集合 BigDecimal sumValue = list.stream().ma 阅读全文
posted @ 2024-10-28 17:56 一隅桥畔 阅读(165) 评论(0) 推荐(0) 编辑
摘要:struts2上传文件时,超过了默认文件大小 查看struts.properties配置文件(默认2M) 修改文件大小(例如100M)struts.multipart.maxSize=104857600 阅读全文
posted @ 2024-07-29 18:25 一隅桥畔 阅读(30) 评论(0) 推荐(0) 编辑
摘要:List<Integer> list = new ArrayList<>(); int size = list.size(); int batchSize = 10; for (int i = 0; i < size; i += batchSize) { int fromIndex = i; int 阅读全文
posted @ 2024-07-12 17:12 一隅桥畔 阅读(60) 评论(0) 推荐(0) 编辑
摘要:String str = "(20/84)*100"; ScriptEngine se = new ScriptEngineManager().getEngineByName("JavaScript"); try { Object eval = se.eval(str); System.out.pr 阅读全文
posted @ 2024-07-12 17:12 一隅桥畔 阅读(19) 评论(0) 推荐(0) 编辑
摘要:BigDecimal decimal = new BigDecimal("3.116"); //四舍五入(>=5进位) BigDecimal decimal1 = decimal.setScale(2, BigDecimal.ROUND_HALF_UP); //四舍五入(>5进位) BigDecim 阅读全文
posted @ 2024-06-28 17:47 一隅桥畔 阅读(185) 评论(0) 推荐(0) 编辑
摘要:List<Integer> list = new ArrayList<>(); list.add(1); list.add(2); list.add(3); //是否至少一个元素满足 boolean match = list.stream().anyMatch(i -> i > 2 && i < 6 阅读全文
posted @ 2024-06-28 16:41 一隅桥畔 阅读(94) 评论(0) 推荐(0) 编辑
摘要:List<String> list = new ArrayList<>(); List<BigDecimal> newList = list.stream().map(BigDecimal::new).collect(Collectors.toList()); 阅读全文
posted @ 2024-06-28 16:12 一隅桥畔 阅读(16) 评论(0) 推荐(0) 编辑
摘要:Map<String, List<OperationNodeVo>> listMap = nodeVoList.stream().collect(Collectors.groupingBy(OperationNodeVo::getNodeCode)); 阅读全文
posted @ 2024-04-26 15:03 一隅桥畔 阅读(152) 评论(0) 推荐(0) 编辑
摘要:List<Map<String, Object>> list = new ArrayList<>(); Map<String, Object> map1 = new HashMap<>(); map1.put("name", "苹果"); map1.put("code", "apple"); lis 阅读全文
posted @ 2024-04-15 14:29 一隅桥畔 阅读(237) 评论(0) 推荐(0) 编辑
摘要:/** * 返回中文的首字母 */ public static String getPinYinHeadChar(String str) { String sb = ""; for (int j = 0; j < str.length(); j++) { char word = str.charAt 阅读全文
posted @ 2024-01-31 22:36 一隅桥畔 阅读(37) 评论(0) 推荐(0) 编辑
摘要:31-Jan-2024 14:01:13.812 信息 [main] org.apache.coyote.AbstractProtocol.start 开始协议处理句柄["http-nio-8080"] 31-Jan-2024 14:01:13.818 严重 [main] org.apache.ca 阅读全文
posted @ 2024-01-31 14:12 一隅桥畔 阅读(892) 评论(0) 推荐(0) 编辑
摘要:List<Map<String,Object>> list = new ArrayList<>(); Map<String,Object> map1 = new HashMap<>(); map1.put("code","01"); map1.put("name","小张"); map1.put(" 阅读全文
posted @ 2024-01-30 17:20 一隅桥畔 阅读(583) 评论(0) 推荐(0) 编辑
摘要://字符串转json数组 String str = "[{\"code\":\"0001\",\"name\":\"050\"},{\"code\":\"0002\",\"name\":\"185\"}]"; JSONArray deptArray = JSONArray.parseArray(st 阅读全文
posted @ 2023-11-29 17:57 一隅桥畔 阅读(294) 评论(0) 推荐(0) 编辑
摘要:1、依赖sun.misc.BASE64Decoder.jar /** * Base64编码 * @param data 要加密的字符数组 * @return String 加密后的16进制字符串 */ public static String encode(byte[] data){ return 阅读全文
posted @ 2023-08-24 09:20 一隅桥畔 阅读(93) 评论(0) 推荐(0) 编辑
摘要:/** * request中参数转换成map */ public static Map<String, String> requestParamsToMap(HttpServletRequest request) { Map<String, String> reqMap = new HashMap< 阅读全文
posted @ 2023-08-23 23:03 一隅桥畔 阅读(61) 评论(0) 推荐(0) 编辑
摘要:<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <configuration> <webResources> <resource> <!--打包时将lib里面 阅读全文
posted @ 2023-08-01 18:37 一隅桥畔 阅读(54) 评论(0) 推荐(0) 编辑
摘要:package com.lbdz.bsf.util; import net.sf.json.JSONObject; import net.sf.json.JSONSerializer; import net.sf.json.xml.XMLSerializer; /** * xml和json转换 */ 阅读全文
posted @ 2023-06-16 17:36 一隅桥畔 阅读(602) 评论(0) 推荐(0) 编辑
摘要:BigDecimal a = new BigDecimal(10); BigDecimal b = new BigDecimal(2); if(a.compareTo(b) == 0){ System.out.println("a等于b"); } if(a.compareTo(b) == 1){ S 阅读全文
posted @ 2023-02-02 15:34 一隅桥畔 阅读(419) 评论(0) 推荐(0) 编辑
摘要:/** * 自适应列宽 * @param sheet * @param columnLength 列数 */ private static void setSizeColumn(HSSFSheet sheet, int columnLength) { for (int columnNum = 0; 阅读全文
posted @ 2022-09-17 11:25 一隅桥畔 阅读(702) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示