HashM /* * 常用方法:compute、computeIfAbsent、computeIfPresent、merge * containsKey、containsValue、get、 * put、putAll、clear、remove、isEmpty、size * entrySet(可进行流 ...
分类:
其他好文 时间:
2020-05-24 19:23:33
阅读次数:
57
if (null !=merchLadderRatesRecords && merchLadderRatesRecords.size() !=0 && merchLadderRatesRecords.isEmpty() ){ for (MerchLadderRateRecord merchLadde ...
分类:
其他好文 时间:
2020-05-20 18:37:54
阅读次数:
42
在我们日常开发中,判空应该是最常用的一个操作了。因此项目中总是少不了依赖commons-lang3包。这个包为我们提供了两个判空的方法,分别是StringUtils.isEmpty(CharSequencecs)和StringUtils.isBlank(CharSequencecs)。我们分别来看看这两个方法有什么区别。一、StringUtils.isEmptyisEmpty的源码如下:publi
分类:
其他好文 时间:
2020-05-19 18:09:26
阅读次数:
43
在我们日常开发中,判空应该是最常用的一个操作了。因此项目中总是少不了依赖commons lang3包。这个包为我们提供了两个判空的方法,分别是StringUtils.isEmpty(CharSequence cs)和StringUtils.isBlank(CharSequence cs)。我们分别来 ...
分类:
其他好文 时间:
2020-05-18 10:49:12
阅读次数:
52
对接入库数据,有时候数据量比较大,需要分批入库,写了一个分批入库的小方法 if (!CollectionUtils.isEmpty(student)) { // 计数器 int count = 1; int total = student.size(); List<StudentEntity> st ...
分类:
编程语言 时间:
2020-05-15 17:58:00
阅读次数:
128
```java @RequestMapping("/test1") public ResponseEntity testControllerAdvice(String id) { if (StringUtils.isEmpty(id)) { throw new UserNotExistExcepti... ...
分类:
其他好文 时间:
2020-05-02 00:27:45
阅读次数:
74
# -*- coding:utf-8 -*-#@Time : 2020/5/1 22:15#@Author: Aluosen#@File : Queue.py#队列的基本方法class Queue: def __init__(self): self.items = [] def isEmpty(se ...
分类:
编程语言 时间:
2020-05-02 00:11:00
阅读次数:
63
底层 :ArrayList是List接口的大小可变数组的实现。 是否允许null :ArrayList允许null元素。 时间复杂度 :size、isEmpty、get、set、iterator和listIterator方法都以固定时间运行,时间复杂度为O(1)。add和remove方法需要O(n) ...
分类:
其他好文 时间:
2020-04-30 19:17:54
阅读次数:
64
1、Collection是java.util的一个接口,它继承了Iterable接口(可以使用for each循环来遍历),它有三个子接口:List,Set与Queue。 2、Collection接口主要接口有: int size():返回容器大小。 boolean isEmpty():判断容器是否 ...
分类:
编程语言 时间:
2020-04-25 00:39:19
阅读次数:
73
Connection接口继承 Iterable,它的主要子类有List接口与Set接口 继承图如下: 据JDK源码,可知Connection接口的常用的抽象方法有: (1)获取集合长度: int size(); (2)判断集合是否为空: boolean isEmpty(); (3)判断集合是否含有某 ...
分类:
其他好文 时间:
2020-04-20 23:58:29
阅读次数:
124