随笔分类 -  JAVA8

摘要:List <String> a = new ArrayList<>(); a.add("123"); // a.add("3213"); // a.add("3213"); // a.add("213"); // a.add("123"); // a.add("321"); // a.add("55 阅读全文
posted @ 2023-02-01 11:22 Arborblog 阅读(548) 评论(0) 推荐(0) 编辑
摘要://LocalDateTime转Timestamp Timestamp timestamp = new Timestamp(TwoWeeksAgo.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli()); 阅读全文
posted @ 2022-09-13 11:10 Arborblog 阅读(57) 评论(0) 推荐(0) 编辑
摘要:import java.sql.Timestamp; import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneId; import java.time.ZonedDateTime; import j 阅读全文
posted @ 2022-07-04 19:02 Arborblog 阅读(13) 评论(0) 推荐(0) 编辑
摘要:import org.junit.Test; import java.time.*; import java.time.format.DateTimeFormatter; import java.time.temporal.TemporalAdjuster; import java.time.tem 阅读全文
posted @ 2022-07-04 17:53 Arborblog 阅读(24) 评论(0) 推荐(0) 编辑
摘要:posRecordList.stream() .collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getTransactionNo( 阅读全文
posted @ 2022-06-27 21:10 Arborblog 阅读(40) 评论(0) 推荐(0) 编辑
摘要:Stream API 一.创建Stream //1.Colleaction系列集合提供 List<String> list = new ArrayList<>(); Stream<String> stream = list.stream(); //2.Arrays的静态方法stream(); Emp 阅读全文
posted @ 2022-06-24 18:17 Arborblog 阅读(29) 评论(0) 推荐(0) 编辑
摘要:方法引用 Lambda有方法已经完成了 1.对象::实例方法名 //案例1: Consume<String> consume = (x) -> System.out.println(x); //方法的参数类型和返回值要和要引用的方法的参数类型和返回值一致 PrintStream ps = Syste 阅读全文
posted @ 2022-06-24 14:32 Arborblog 阅读(44) 评论(0) 推荐(0) 编辑
摘要:Lambda语法格式 1.无参,无返回值 Runnable runnable = () -> System.out.println("无参,无返回值"); runnable.run(); 2.一个参数,无返回值--只有一个参数小阔号可以不写 Consumer<String> consumer = ( 阅读全文
posted @ 2022-06-24 11:44 Arborblog 阅读(111) 评论(0) 推荐(0) 编辑
摘要:简单的Lambda表达式 import org.junit.Test; import java.util.Comparator; //Arbor 2022/6/24 public class TestLambda { //匿名内部类 @Test public void test1(){ Compar 阅读全文
posted @ 2022-06-24 11:04 Arborblog 阅读(24) 评论(0) 推荐(0) 编辑
摘要:Car{ Timestamp DateCreated } Map<Timestamp, List<Car>> CarMap = reservePeriodList.stream().collect(groupingBy(Car::getDateCreated)); 阅读全文
posted @ 2022-06-09 17:32 Arborblog 阅读(40) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2022-06-07 00:57 Arborblog 阅读(24) 评论(0) 推荐(0) 编辑

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