摘要: package com.zxwa.ntmss.process.common.util; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONO 阅读全文
posted @ 2021-01-06 21:43 Bonnie_ξ 阅读(48) 评论(0) 推荐(0) 编辑
摘要: 1.以下是封装了ES常用的基本方法,可以用来做一些简单的测试。 如:获取ES的TransportClient/IndicesAdminClient、判定索引是否存在、创建索引、设置mapping、删除索引、插入文档。 package com.bas.util; import org.elastics 阅读全文
posted @ 2021-01-06 15:27 Bonnie_ξ 阅读(347) 评论(0) 推荐(0) 编辑
摘要: "mappings": { "player": { "properties": { "name": { "index": "not_analyzed", "type": "string" }, "age": { "type": "integer" }, "salary": { "type": "in 阅读全文
posted @ 2021-01-06 15:21 Bonnie_ξ 阅读(976) 评论(0) 推荐(0) 编辑
摘要: 全部代码展示: package com.drew.util; import java.time.DayOfWeek; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.LocalTime; imp 阅读全文
posted @ 2020-12-31 16:19 Bonnie_ξ 阅读(203) 评论(0) 推荐(0) 编辑
摘要: 1、取当前时间戳 Long millisecond = Instant.now().toEpochMilli(); // 精确到毫秒 Long second = Instant.now().getEpochSecond();// 精确到秒 2、将Long类型的时间戳转成字符串 /** * 将Long 阅读全文
posted @ 2020-12-31 16:17 Bonnie_ξ 阅读(10222) 评论(0) 推荐(0) 编辑
摘要: LocalDate、LocalTime、Instant、Duration、Period 1.1使用LocalDate和LocalTime 1.1.1LocalDate的创建方式和相关方法使用示例 public void localDate() { LocalDate date = LocalDate 阅读全文
posted @ 2020-12-31 16:15 Bonnie_ξ 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 一.简述 在Java8中,我们可以使用以下类来计算日期时间差异: 1.Period 2.Duration 3.ChronoUnit 二.Period类 主要是Period类方法getYears(),getMonths()和getDays()来计算. 示例: package insping; impo 阅读全文
posted @ 2020-12-31 16:07 Bonnie_ξ 阅读(884) 评论(0) 推荐(0) 编辑
摘要: 1.背景: countDownLatch是在java1.5被引入,跟它一起被引入的工具类还有CyclicBarrier、Semaphore、concurrentHashMap和BlockingQueue。 存在于java.util.cucurrent包下。 2.概念 countDownLatch这个 阅读全文
posted @ 2020-12-31 11:28 Bonnie_ξ 阅读(93) 评论(0) 推荐(0) 编辑
摘要: 定义 一个基于链接节点的无界线程安全队列。此队列按照 FIFO(先进先出)原则对元素进行排序。队列的头部 是队列中时间最长的元素。队列的尾部 是队列中时间最短的元素。 新的元素插入到队列的尾部,队列获取操作从队列头部获得元素。当多个线程共享访问一个公共 collection 时,Concurrent 阅读全文
posted @ 2020-12-31 11:20 Bonnie_ξ 阅读(449) 评论(0) 推荐(0) 编辑
摘要: 1.1 java8自带的常用函数式接口。 public class Test { public static void main(String[] args) { Predicate<Integer> predicate = x -> x > 185; Student student = new S 阅读全文
posted @ 2020-12-30 17:04 Bonnie_ξ 阅读(100) 评论(0) 推荐(0) 编辑