Example usage for java.util Map of

List of usage examples for java.util Map of

Introduction

In this page you can find the example usage for java.util Map of.

Prototype

static <K, V> Map<K, V> of(K k1, V v1, K k2, V v2) 

Source Link

Document

Returns an unmodifiable map containing two mappings.

Usage

From source file:Main.java

private static void immutableUtil() {
    System.out.println("----------immutableUtil----------");
    Map<String, String> immutableMap = ImmutableMap.of("a", "A", "b", "B");
    System.out.println(immutableMap);
    List<String> immutableList = ImmutableList.of("a", "b", "c");
    System.out.println(immutableList);
    BiMap<String, Integer> biMap = ImmutableBiMap.of("a", 1, "b", 2);
    System.out.println(biMap.inverse());
    System.out.println(biMap);/*from   ww  w.j a  v a2  s .  c o m*/
}