随笔分类 -  java

摘要:List<Integer> list2 = mapDemo.keySet().stream().collect(Collectors.toList()); --主键 List<Integer> list2 = mapDemo.values().stream().collect(Collectors. 阅读全文
posted @ 2024-08-22 14:17 酷盖的小机灵 阅读(9) 评论(0) 推荐(0) 编辑
摘要:import java.util.List; public class StdDevCalculator { public static double calculateStdDev(List<Double> numbers) { if (numbers.isEmpty()) { return 0; 阅读全文
posted @ 2024-08-02 17:15 酷盖的小机灵 阅读(17) 评论(0) 推荐(0) 编辑
摘要:package com.dc.galaxydata.model; import com.dc.common.util.DateUtil; import java.util.ArrayList; import java.util.Date; public class EndDates { public 阅读全文
posted @ 2024-07-02 11:06 酷盖的小机灵 阅读(22) 评论(0) 推荐(0) 编辑
摘要:package com.dc.galaxydata.model; import com.dc.common.util.DateUtil; import java.util.Calendar; import java.util.Date; public class DateLastEndUtil { 阅读全文
posted @ 2024-07-02 11:03 酷盖的小机灵 阅读(107) 评论(0) 推荐(0) 编辑
摘要:WindowSpec windowSpec = Window.partitionBy("productCode", "taSystemCode").orderBy("remainVol");Dataset<Row> rowDataset = dataset.withColumn("序号命名", ra 阅读全文
posted @ 2024-06-13 16:50 酷盖的小机灵 阅读(10) 评论(0) 推荐(0) 编辑
摘要:/** * 统计两个时间的时间差 * two-one * 相差几秒几毫秒 */ public static String getDistanceTime(Date date1, Date date2) { Date one; Date two; long day = 0;//天数差 long hou 阅读全文
posted @ 2023-04-03 10:20 酷盖的小机灵 阅读(30) 评论(0) 推荐(0) 编辑
摘要://设置对象属性值,返回对象 public <T> T saveValue(T t,String name,String value){ // Class<? extends Object> c = t.getClass(); //得到属性--具体某一个 Field field = t.getCla 阅读全文
posted @ 2022-11-18 14:01 酷盖的小机灵 阅读(35) 评论(0) 推荐(0) 编辑
摘要:1 /** 2 * 比较两个实体属性值,返回一个map以有差异的属性名为key,value为一个Map分别存oldObject,newObject此属性名的值 3 * 4 * @param oldObject 进行属性比较的对象1 5 * @param newObject 进行属性比较的对象2 6 阅读全文
posted @ 2022-11-15 10:58 酷盖的小机灵 阅读(25) 评论(0) 推荐(0) 编辑
摘要:1 public static String specialFormatDateSplicing(Date date) { 2 if (date == null) { 3 return null; 4 } 5 LocalDateTime localDateTime = convertDateToLo 阅读全文
posted @ 2022-11-11 15:48 酷盖的小机灵 阅读(130) 评论(0) 推荐(0) 编辑
摘要:1 String regex = "(\\$|\\#)\\{[^{}]*\\}";//匹配的是#{xxx}或者${xxx} 2 List<WatcherTaskAgentFileMapping> watcherTaskAgentFileMappingList = agentFileQueryDao. 阅读全文
posted @ 2022-11-11 14:55 酷盖的小机灵 阅读(1659) 评论(0) 推荐(1) 编辑
摘要:delete()方法和deleteCharAt()方法 delete()方法和deleteCharAt()方法都是用来删除StringBuilder字符串指定字符索引的方法,其中 delete(int a,int b)方法:包含两个参数,使用时删除索引从a到b(包括a不包括b)的所有字符; dele 阅读全文
posted @ 2022-11-10 15:21 酷盖的小机灵 阅读(30) 评论(0) 推荐(0) 编辑
摘要:1、用JAVA自带的函数 1 public static boolean isNumeric(String str) { 2 for (int i = 0; i < str.length(); i++) { 3 System.out.println(str.charAt(i)); 4 if (!Ch 阅读全文
posted @ 2022-11-10 15:13 酷盖的小机灵 阅读(474) 评论(0) 推荐(0) 编辑
摘要:1 private void queryStartDateAndEndDateByDateLimit(String dateLimit, QueryTaskLogStartDateDTO queryTaskLogStartDateDTO) { 2 Integer year = Integer.par 阅读全文
posted @ 2022-11-10 15:07 酷盖的小机灵 阅读(1134) 评论(0) 推荐(0) 编辑
摘要:排序查询 1 Map<String, Object> conditions = new HashMap<>(); 2 conditions.put("delFlag", false); 3 conditions.put("sortColumns", " code desc");//排序要用数据库字段 阅读全文
posted @ 2022-11-10 08:58 酷盖的小机灵 阅读(22) 评论(0) 推荐(0) 编辑
摘要:Java8 list stream方式 List<String> nameList = personList.stream().map(Person::getName).collect(toList()); 阅读全文
posted @ 2022-08-03 17:26 酷盖的小机灵 阅读(110) 评论(0) 推荐(0) 编辑
摘要:序列化: 对象转json 1 ObjectMapper objectMapper = new ObjectMapper(); 2 String jsonStr = objectMapper.writeValueAsString(dataDTO); 反序列化: json转列表 1 ObjectMapp 阅读全文
posted @ 2022-08-03 17:23 酷盖的小机灵 阅读(111) 评论(0) 推荐(0) 编辑
摘要:1 public class NumberUtils { 2 3 private static final String MILLION_UNIT = "万"; 4 private static final String BILLION_UNIT = "亿"; 5 private static fi 阅读全文
posted @ 2022-08-03 17:20 酷盖的小机灵 阅读(2365) 评论(0) 推荐(0) 编辑
摘要:1 public class MyUtils { 2 /** 3 * 以季度分割时间段 4 * 此处季度是以 12-2月 3-5月 6-8月 9-11月 划分 5 * @param startTime 开始时间戳(毫秒) 6 * @param endTime 结束时间戳(毫秒) 7 * @param 阅读全文
posted @ 2022-08-03 17:18 酷盖的小机灵 阅读(1530) 评论(0) 推荐(0) 编辑
摘要:1 import java.io.File; 2 public class Flie_or_Folder { 3 4 public static void main(String s[]){ 5 String path ="/Users/XXXXX/Desktop/one"; 6 File file 阅读全文
posted @ 2022-08-03 16:50 酷盖的小机灵 阅读(1228) 评论(1) 推荐(0) 编辑

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