/** * Returns an ImmutableMapParameter instance containing a single entry. * * @param k0 * Key of the single entry. * @param v0 * Value of the single entry. */ public static <K, V> ImmutableMapParameter<K, V> of(K k0, V v0) { Map<K, V> map = Collections.singletonMap(k0, v0); return new ImmutableMapParameter<K, V>(map); }
/** * Generates and returns a new ImmutableMapParameter instance which * contains all the entries added into the Builder by {@code put()} * method. */ public ImmutableMapParameter<K, V> build() { HashMap<K, V> builtMap = new HashMap<K, V>(); builtMap.putAll(entries); return new ImmutableMapParameter<K, V>(builtMap); } }
/** * Returns an ImmutableMapParameter instance containing two entries. * * @param k0 * Key of the first entry. * @param v0 * Value of the first entry. * @param k1 * Key of the second entry. * @param v1 * Value of the second entry. */ public static <K, V> ImmutableMapParameter<K, V> of(K k0, V v0, K k1, V v1) { Map<K, V> map = new HashMap<K, V>(); putAndWarnDuplicateKeys(map, k0, v0); putAndWarnDuplicateKeys(map, k1, v1); return new ImmutableMapParameter<K, V>(map); }
/** * Returns an ImmutableMapParameter instance containing three entries. * * @param k0 * Key of the first entry. * @param v0 * Value of the first entry. * @param k1 * Key of the second entry. * @param v1 * Value of the second entry. * @param k2 * Key of the third entry. * @param v2 * Value of the third entry. */ public static <K, V> ImmutableMapParameter<K, V> of(K k0, V v0, K k1, V v1, K k2, V v2) { Map<K, V> map = new HashMap<K, V>(); putAndWarnDuplicateKeys(map, k0, v0); putAndWarnDuplicateKeys(map, k1, v1); putAndWarnDuplicateKeys(map, k2, v2); return new ImmutableMapParameter<K, V>(map); }
/** * Returns an ImmutableMapParameter instance containing four entries. * * @param k0 * Key of the first entry. * @param v0 * Value of the first entry. * @param k1 * Key of the second entry. * @param v1 * Value of the second entry. * @param k2 * Key of the third entry. * @param v2 * Value of the third entry. * @param k3 * Key of the fourth entry. * @param v3 * Value of the fourth entry. */ public static <K, V> ImmutableMapParameter<K, V> of(K k0, V v0, K k1, V v1, K k2, V v2, K k3, V v3) { Map<K, V> map = new HashMap<K, V>(); putAndWarnDuplicateKeys(map, k0, v0); putAndWarnDuplicateKeys(map, k1, v1); putAndWarnDuplicateKeys(map, k2, v2); putAndWarnDuplicateKeys(map, k3, v3); return new ImmutableMapParameter<K, V>(map); }
putAndWarnDuplicateKeys(map, k3, v3); putAndWarnDuplicateKeys(map, k4, v4); return new ImmutableMapParameter<K, V>(map);
/** * Returns an ImmutableMapParameter instance containing a single entry. * * @param k0 * Key of the single entry. * @param v0 * Value of the single entry. */ public static <K, V> ImmutableMapParameter<K, V> of(K k0, V v0) { Map<K, V> map = Collections.singletonMap(k0, v0); return new ImmutableMapParameter<K, V>(map); }
/** * @return an ImmutableMapParameter instance containing a single entry. * * @param k0 Key of the single entry. * @param v0 Value of the single entry. * @param <K> Class of the key for the map. * @param <V> Class of the value for the map. */ public static <K, V> ImmutableMapParameter<K, V> of(K k0, V v0) { Map<K, V> map = Collections.singletonMap(k0, v0); return new ImmutableMapParameter<K, V>(map); }
/** * Generates and returns a new ImmutableMapParameter instance which * contains all the entries added into the Builder by {@code put()} * method. */ public ImmutableMapParameter<K, V> build() { HashMap<K, V> builtMap = new HashMap<K, V>(); builtMap.putAll(entries); return new ImmutableMapParameter<K, V>(builtMap); } }
/** * Generates and returns a new ImmutableMapParameter instance which * contains all the entries added into the Builder by {@code put()} * method. * @return a new ImmutableMapParameter instance */ public ImmutableMapParameter<K, V> build() { HashMap<K, V> builtMap = new HashMap<K, V>(); builtMap.putAll(entries); return new ImmutableMapParameter<K, V>(builtMap); } }
/** * Returns an ImmutableMapParameter instance containing two entries. * * @param k0 * Key of the first entry. * @param v0 * Value of the first entry. * @param k1 * Key of the second entry. * @param v1 * Value of the second entry. */ public static <K, V> ImmutableMapParameter<K, V> of(K k0, V v0, K k1, V v1) { Map<K, V> map = new HashMap<K, V>(); putAndWarnDuplicateKeys(map, k0, v0); putAndWarnDuplicateKeys(map, k1, v1); return new ImmutableMapParameter<K, V>(map); }
/** * @return an ImmutableMapParameter instance containing two entries. * * @param k0 Key of the first entry. * @param v0 Value of the first entry. * @param k1 Key of the second entry. * @param v1 Value of the second entry. * @param <K> Class of the key for the map. * @param <V> Class of the value for the map. */ public static <K, V> ImmutableMapParameter<K, V> of(K k0, V v0, K k1, V v1) { Map<K, V> map = new HashMap<K, V>(); putAndWarnDuplicateKeys(map, k0, v0); putAndWarnDuplicateKeys(map, k1, v1); return new ImmutableMapParameter<K, V>(map); }
/** * @return an ImmutableMapParameter instance containing three entries. * * @param k0 Key of the first entry. * @param v0 Value of the first entry. * @param k1 Key of the second entry. * @param v1 Value of the second entry. * @param k2 Key of the third entry. * @param v2 Value of the third entry. * @param <K> Class of the key for the map. * @param <V> Class of the value for the map. */ public static <K, V> ImmutableMapParameter<K, V> of(K k0, V v0, K k1, V v1, K k2, V v2) { Map<K, V> map = new HashMap<K, V>(); putAndWarnDuplicateKeys(map, k0, v0); putAndWarnDuplicateKeys(map, k1, v1); putAndWarnDuplicateKeys(map, k2, v2); return new ImmutableMapParameter<K, V>(map); }
/** * Returns an ImmutableMapParameter instance containing three entries. * * @param k0 * Key of the first entry. * @param v0 * Value of the first entry. * @param k1 * Key of the second entry. * @param v1 * Value of the second entry. * @param k2 * Key of the third entry. * @param v2 * Value of the third entry. */ public static <K, V> ImmutableMapParameter<K, V> of(K k0, V v0, K k1, V v1, K k2, V v2) { Map<K, V> map = new HashMap<K, V>(); putAndWarnDuplicateKeys(map, k0, v0); putAndWarnDuplicateKeys(map, k1, v1); putAndWarnDuplicateKeys(map, k2, v2); return new ImmutableMapParameter<K, V>(map); }
/** * @return an ImmutableMapParameter instance containing four entries. * * @param k0 Key of the first entry. * @param v0 Value of the first entry. * @param k1 Key of the second entry. * @param v1 Value of the second entry. * @param k2 Key of the third entry. * @param v2 Value of the third entry. * @param k3 Key of the fourth entry. * @param v3 Value of the fourth entry. * @param <K> Class of the key for the map. * @param <V> Class of the value for the map. */ public static <K, V> ImmutableMapParameter<K, V> of(K k0, V v0, K k1, V v1, K k2, V v2, K k3, V v3) { Map<K, V> map = new HashMap<K, V>(); putAndWarnDuplicateKeys(map, k0, v0); putAndWarnDuplicateKeys(map, k1, v1); putAndWarnDuplicateKeys(map, k2, v2); putAndWarnDuplicateKeys(map, k3, v3); return new ImmutableMapParameter<K, V>(map); }
/** * Returns an ImmutableMapParameter instance containing four entries. * * @param k0 * Key of the first entry. * @param v0 * Value of the first entry. * @param k1 * Key of the second entry. * @param v1 * Value of the second entry. * @param k2 * Key of the third entry. * @param v2 * Value of the third entry. * @param k3 * Key of the fourth entry. * @param v3 * Value of the fourth entry. */ public static <K, V> ImmutableMapParameter<K, V> of(K k0, V v0, K k1, V v1, K k2, V v2, K k3, V v3) { Map<K, V> map = new HashMap<K, V>(); putAndWarnDuplicateKeys(map, k0, v0); putAndWarnDuplicateKeys(map, k1, v1); putAndWarnDuplicateKeys(map, k2, v2); putAndWarnDuplicateKeys(map, k3, v3); return new ImmutableMapParameter<K, V>(map); }
/** * @return an ImmutableMapParameter instance containing five entries. * * @param k0 Key of the first entry. * @param v0 Value of the first entry. * @param k1 Key of the second entry. * @param v1 Value of the second entry. * @param k2 Key of the third entry. * @param v2 Value of the third entry. * @param k3 Key of the fourth entry. * @param v3 Value of the fourth entry. * @param k4 Key of the fifth entry. * @param v4 Value of the fifth entry. * @param <K> Class of the key for the map. * @param <V> Class of the value for the map. */ public static <K, V> ImmutableMapParameter<K, V> of(K k0, V v0, K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4) { Map<K, V> map = new HashMap<K, V>(); putAndWarnDuplicateKeys(map, k0, v0); putAndWarnDuplicateKeys(map, k1, v1); putAndWarnDuplicateKeys(map, k2, v2); putAndWarnDuplicateKeys(map, k3, v3); putAndWarnDuplicateKeys(map, k4, v4); return new ImmutableMapParameter<K, V>(map); }
putAndWarnDuplicateKeys(map, k3, v3); putAndWarnDuplicateKeys(map, k4, v4); return new ImmutableMapParameter<K, V>(map);
/** * @return an ImmutableMapParameter instance containing a single entry. * * @param k0 Key of the single entry. * @param v0 Value of the single entry. * @param <K> Class of the key for the map. * @param <V> Class of the value for the map. */ public static <K, V> ImmutableMapParameter<K, V> of(K k0, V v0) { Map<K, V> map = Collections.singletonMap(k0, v0); return new ImmutableMapParameter<K, V>(map); }
/** * Generates and returns a new ImmutableMapParameter instance which * contains all the entries added into the Builder by {@code put()} * method. * @return a new ImmutableMapParameter instance */ public ImmutableMapParameter<K, V> build() { HashMap<K, V> builtMap = new HashMap<K, V>(); builtMap.putAll(entries); return new ImmutableMapParameter<K, V>(builtMap); } }