Guava
- ImmutableList
用ImmutableList構建List:
import com.google.common.collect.ImmutableList;
import org.junit.Test;
import java.util.List;
import static org.junit.Assert.assertEquals;
public class ImmutableListStudyTest {
@Test
public void test_Immutable_List() throws Exception {
List<Object> params = ImmutableList.builder()
.add(1)
.add("2")
.add(3L)
.build();
assertEquals(params.get(0), 1);
assertEquals(params.get(1), "2");
assertEquals(params.get(2), 3L);
}
}
compile group: 'com.google.guava', name: 'guava', version: '23.5-jre
相關文章
- [Guava] Google Guava 集合工具類GuavaGo
- Guava文件翻譯之 Guava簡介Guava
- Guava CacheGuava
- Guava futureGuava
- Google Guava 使用者指南 —- 初始Guava類庫GoGuava
- Guava RateLimiter限流GuavaMIT
- 《Google Guava—集合篇》GoGuava
- Guava庫介紹Guava
- google guava集合之MultisetGoGuava
- guava之Joiner 和 SplitterGuava
- Guava翻譯之SmallFunctionGuavaFunction
- Guava 之 Joiner 和 SplitterGuava
- (翻譯)Google Guava CacheGoGuava
- Google guava原始碼之EventBusGoGuava原始碼
- Guava RateLimiter限流器使用示例GuavaMIT
- Guava集合--Immutable(不可變)集合Guava
- Guava集合--新集合型別Guava型別
- Guava字串處理Joiner、SplitterGuava字串
- 強大的 Guava 工具類Guava
- Guava 原始碼分析(Cache 原理)Guava原始碼
- Guava學習:Cache快取Guava快取
- Guava原始碼淺析——JoinerGuava原始碼
- Guava ListenableFuture介紹以及使用Guava
- guava翻譯系列之JoinerGuava
- guava翻譯系列之SplitterGuava
- Guava文件翻譯之 ServiceGuava
- Guava文件翻譯之ListenableFutureGuava
- Guava中的Joiner和SplitterGuava
- 重試利器之Guava RetryingGuava
- Guava的布隆過濾器Guava過濾器
- Guava Retryer實現介面重試Guava
- google guava的BiMap:雙向MapGoGuava
- Java-TreeMap和Guava-HashMultisetJavaGuava
- Google Guava Stopwatch(計時器)GoGuava
- Guava的Supplier實現單例Guava單例
- Guava HashMultimap使用及注意事項Guava
- guava cache過期方案實踐Guava
- Google Guava官方教程(中文版)GoGuava