当前位置:网站首页>Guava tutorial collect some cases and write Google tool classes slowly
Guava tutorial collect some cases and write Google tool classes slowly
2022-06-27 07:17:00 【Exquisite·】
Reference resources
Article, understand guava
Translation of official documents
Achieve the goal
- understand Lists Sets Maps And other common methods of collection classes
- understand guava Collections2 and jdk Collections hutool CollectionUtil
- understand guava ListenableFuture Of And Java Native Future Use
problem
- How to get the iterator of the collection class
- Collections Why are there so many internal classes ( To return a class object )
Collection classes
// map Copy
@Test
public void test4() throws IllegalAccessException {
HashMap<String, String> hashMap = Maps.newHashMap();
hashMap.put("1","A");
hashMap.put("2","B");
Map<String, String> res ;
res = ImmutableMap.copyOf(hashMap);
System.out.println(JSON.toJSONString(res));
}
Initialization of collection classes
// Ordinary Collection The creation of
List<String> list = Lists.newArrayList();
Set<String> set = Sets.newHashSet();
Map<String, String> map = Maps.newHashMap();
// unchanged Collection The creation of
ImmutableList<String> iList = ImmutableList.of("a", "b", "c");
ImmutableSet<String> iSet = ImmutableSet.of("e1", "e2");
ImmutableMap<String, String> iMap = ImmutableMap.of("k1", "v1", "k2", "v2");
边栏推荐
- 内存屏障今生之Store Buffer, Invalid Queue
- 在线文本数字识别列表求和工具
- 一个人管理1000台服务器?这款自动化运维工具一定要掌握
- AHB2APB桥接器设计(2)——同步桥设计的介绍
- Currying Scala functions
- Interviewer: please introduce cache penetration, cache null value, cache avalanche and cache breakdown, which are easy to understand
- [graduation season] graduation is the new beginning of your life journey. Are you ready
- The number of query results of maxcompute SQL is limited to 1W
- oracle的similarity方法实现原理
- Gérer 1000 serveurs par personne? Cet outil d'automatisation o & M doit être maîtrisé
猜你喜欢

从5秒优化到1秒,系统飞起来了...

Solve the problem of win10 wsl2 IP change

一线大厂面试官问:你真的懂电商订单开发吗?

DMU software syntax highlighting VIM setting -- Learning Notes 6

Fast realization of Bluetooth communication between MCU and mobile phone

Redis cache penetration, cache breakdown, cache avalanche

面试官:请你介绍一下缓存穿透、缓存空值、缓存雪崩、缓存击穿的,通俗易懂

Interviewer: do you have any plan to request a lot of data that does not exist in redis to destroy the database?

Classical cryptosystem -- substitution and replacement

Meaning of 0.0.0.0:x
随机推荐
2022 CISP-PTE(一)文件包含
Instance Tunnel 使用
【编译原理】山东大学编译原理复习提纲
AHB2APB桥接器设计(2)——同步桥设计的介绍
一個人管理1000臺服務器?這款自動化運維工具一定要掌握
快速实现单片机和手机蓝牙通信
面试官:用分库分表如何做到永不迁移数据和避免热点问题?
IDEA连接数据库报错
Optimistic and pessimistic affairs
Interviewer: how to never migrate data and avoid hot issues by using sub database and sub table?
Meaning of 0.0.0.0:x
Overview of database schema in tidb
内存屏障今生之Store Buffer, Invalid Queue
POI export excle
The number of query results of maxcompute SQL is limited to 1W
Scala advanced_ Member access modifier
boundvalueops和opsforvalue区别
Once spark reported an error: failed to allocate a page (67108864 bytes), try again
pytorch Default process group is not initialized
oracle的similarity方法实现原理