
jdk8新特性
非衣鲲化
这个作者很懒,什么都没留下…
展开
-
jdk8获取最大时间的对象
有时候我们需要知道最大最小对应的这个对象,我们可以通过如下方法获取Comparator<LeasingBusinessContract> comparator = Comparator.comparing(LeasingBusinessContract::getLeaseEndDate);LeasingBusinessContract maxObject = leasingBusinessContractList.stream().max(comparator).get();...原创 2020-10-13 22:19:53 · 3973 阅读 · 0 评论 -
时间戳
public static int getTimeStamp(){ int timeStamp = 1; try { OrderRepository repository = SpringApplicationContextHolder.getSpringBean(OrderRepository.class); BizOrder bizOrder = repository.queryByServiceNo(serviceNo..原创 2020-09-14 22:22:07 · 461 阅读 · 0 评论 -
jdk8中String.join()的使用
可以直接给字符串数组或则list集合增加一个字符然后转化为String 字符串,例如:public static void main(String[] args) { List<String> list = new ArrayList<String>(); list.add("s1"); list.add("s3");...原创 2020-03-31 14:26:06 · 855 阅读 · 0 评论 -
jdk8的使用
public AffairHandingContext getOne(String orderId) { Assert.notNull(orderId,"orderId cannot null"); OrderHandingContextDO orderHandingContextDO = orderHandingContextDOMapper.selec...原创 2020-03-12 22:55:42 · 293 阅读 · 0 评论 -
mapstruct中对常量的引用
对常量引用不能用source@Mapping(target ="stringConstant", constant ="Constant Value")原创 2020-02-18 18:10:59 · 2486 阅读 · 0 评论 -
jdk8 的一些东西
long lCount2 = list.stream().filter(employee -> employee.getSalary() == 2000).count();1、 .count()是获取符合条件的有多少个。2、 list.stream().map().collect(Collectors.toList()); 这个就是在遍历的过程中然后执...原创 2020-02-16 17:02:23 · 123 阅读 · 0 评论 -
查看代码心看到的一些技术点
查看代码遇到的问题: 1、为什么在最后的repository 中都需要进行convert 转化一下结果? 这里是使用了mapstruct 将普通的pojo类转化为 dto 或者 do类。2、@InvocationDurationLogger(name = "repository") @InvocationDurationLogger(name = "facade") ...原创 2020-01-17 14:35:35 · 275 阅读 · 0 评论 -
mapstruct的使用
http://www.debugger.wiki/article/html/1559138432195940原创 2020-01-13 15:37:33 · 228 阅读 · 0 评论