@Override public V put(K key, V value) { synchronized (this.lock) { return this.getDelegate().put(key, value); } }
@Override public V put(K key, V value) { synchronized (this.lock) { return this.getDelegate().put(key, value); } }
public static <T, K, R extends MutableMapIterable<K, T>> R groupByUniqueKey( T[] array, int size, Function<? super T, ? extends K> function, R target) { for (int i = 0; i < size; i++) { T value = array[i]; K key = function.valueOf(value); if (target.put(key, value) != null) { throw new IllegalStateException("Key " + key + " already exists in map!"); } } return target; }
@Override public <VV, R extends MutableMapIterable<VV, V>> R groupByUniqueKey(Function<? super V, ? extends VV> function, R target) { if (target.put(function.valueOf(this.value1), this.value1) != null) { throw new IllegalStateException("Key " + function.valueOf(this.value1) + " already exists in map!"); } return target; }
@Override public <VV, R extends MutableMapIterable<VV, V>> R groupByUniqueKey(Function<? super V, ? extends VV> function, R target) { if (target.put(function.valueOf(this.value1), this.value1) != null) { throw new IllegalStateException("Key " + function.valueOf(this.value1) + " already exists in map!"); } return target; }
@Override public <VV, R extends MutableMapIterable<VV, V>> R groupByUniqueKey(Function<? super V, ? extends VV> function, R target) { if (target.put(function.valueOf(this.value1), this.value1) != null) { throw new IllegalStateException("Key " + function.valueOf(this.value1) + " already exists in map!"); } return target; }
@Override public <VV, R extends MutableMapIterable<VV, V>> R groupByUniqueKey(Function<? super V, ? extends VV> function, R target) { if (target.put(function.valueOf(this.value1), this.value1) != null) { throw new IllegalStateException("Key " + function.valueOf(this.value1) + " already exists in map!"); } return target; }
@Override public <VV, R extends MutableMapIterable<VV, V>> R groupByUniqueKey(Function<? super V, ? extends VV> function, R target) { if (target.put(function.valueOf(this.value1), this.value1) != null) { throw new IllegalStateException("Key " + function.valueOf(this.value1) + " already exists in map!"); } return target; }
@Override public <VV, R extends MutableMapIterable<VV, V>> R groupByUniqueKey(Function<? super V, ? extends VV> function, R target) { if (target.put(function.valueOf(this.value1), this.value1) != null) { throw new IllegalStateException("Key " + function.valueOf(this.value1) + " already exists in map!"); } return target; }
@Override public <VV, R extends MutableMapIterable<VV, V>> R groupByUniqueKey(Function<? super V, ? extends VV> function, R target) { if (target.put(function.valueOf(this.value1), this.value1) != null) { throw new IllegalStateException("Key " + function.valueOf(this.value1) + " already exists in map!"); } return target; }
@Override public <VV, R extends MutableMapIterable<VV, V>> R groupByUniqueKey(Function<? super V, ? extends VV> function, R target) { if (target.put(function.valueOf(this.value1), this.value1) != null) { throw new IllegalStateException("Key " + function.valueOf(this.value1) + " already exists in map!"); } return target; }
@Override public <VV, R extends MutableMapIterable<VV, V>> R groupByUniqueKey(Function<? super V, ? extends VV> function, R target) { if (target.put(function.valueOf(this.value1), this.value1) != null) { throw new IllegalStateException("Key " + function.valueOf(this.value1) + " already exists in map!"); } return target; }
@Override public <VV, R extends MutableMapIterable<VV, V>> R groupByUniqueKey(Function<? super V, ? extends VV> function, R target) { if (target.put(function.valueOf(this.value1), this.value1) != null) { throw new IllegalStateException("Key " + function.valueOf(this.value1) + " already exists in map!"); } return target; }
@Override public <VV, R extends MutableMapIterable<VV, V>> R groupByUniqueKey(Function<? super V, ? extends VV> function, R target) { if (target.put(function.valueOf(this.value1), this.value1) != null) { throw new IllegalStateException("Key " + function.valueOf(this.value1) + " already exists in map!"); } return target; }
@Override public <VV, R extends MutableMapIterable<VV, V>> R groupByUniqueKey(Function<? super V, ? extends VV> function, R target) { if (target.put(function.valueOf(this.value1), this.value1) != null) { throw new IllegalStateException("Key " + function.valueOf(this.value1) + " already exists in map!"); } return target; }
@Override public <VV, R extends MutableMapIterable<VV, V>> R groupByUniqueKey(Function<? super V, ? extends VV> function, R target) { if (target.put(function.valueOf(this.value1), this.value1) != null) { throw new IllegalStateException("Key " + function.valueOf(this.value1) + " already exists in map!"); } return target; }
@Override public <VV, R extends MutableMapIterable<VV, V>> R groupByUniqueKey(Function<? super V, ? extends VV> function, R target) { if (target.put(function.valueOf(this.value1), this.value1) != null) { throw new IllegalStateException("Key " + function.valueOf(this.value1) + " already exists in map!"); } return target; }
/** * This method allows mutable map the ability to add an element in the form of {@code Pair<? extends K, ? extends V>}. * * @see #put(Object, Object) * @since 9.1.0 */ default V putPair(Pair<? extends K, ? extends V> keyValuePair) { return this.put(keyValuePair.getOne(), keyValuePair.getTwo()); }
/** * This method allows mutable map the ability to add an element in the form of {@code Pair<? extends K, ? extends V>}. * * @see #put(Object, Object) * @since 9.1.0 */ default V putPair(Pair<? extends K, ? extends V> keyValuePair) { return this.put(keyValuePair.getOne(), keyValuePair.getTwo()); }
public static <K, T, R extends MutableMapIterable<K, T>> R groupByUniqueKey( List<T> list, Function<? super T, ? extends K> function, R target) { int size = list.size(); for (int i = 0; i < size; i++) { T value = list.get(i); K key = function.valueOf(value); if (target.put(key, value) != null) { throw new IllegalStateException("Key " + key + " already exists in map!"); } } return target; }