Returns a new immutable map that adds the given fields -> value mapping.
422885
public FieldScopeLogicMap<V> with(FieldScopeLogic fieldScopeLogic, V value) {
    ImmutableList.Builder<Entry<V>> newEntries = ImmutableList.builder();
    // Earlier entries override later ones, so we insert the new one at the front of the list.
    newEntries.add(Entry.of(fieldScopeLogic, value));
    newEntries.addAll(entries);
    return new FieldScopeLogicMap<>(newEntries.build());
  }
993011
public static <K, V> StreamableHashMap<K, V> newMap (Map<? extends K, ? extends V> map)
    {
        return new StreamableHashMap<K, V>(map);
    }
1241734
@Override
  public <VALUEBASE, VALUE extends VALUEBASE, KEY extends Key<CoreMap, VALUEBASE>>
    VALUE set(Class<KEY> key, VALUE value) {
    
    if (immutableKeys.contains(key)) {
      throw new HashableCoreMapException("Attempt to change value " +
      		"of immutable field "+key.getSimpleName());
    }
    
    return super.set(key, value);
  }
1069899
@SuppressWarnings("unchecked")
	public static <K, V> Map<K, V> fieldValueMap(Iterator<V> iter, String fieldName) {
		final Map<K, V> result = new HashMap<>();
		if (null != iter) {
			V value;
			while (iter.hasNext()) {
				value = iter.next();
				result.put((K) ReflectUtil.getFieldValue(value, fieldName), value);
			}
		}
		return result;
	}
927150
public static <K, V, M extends Map<K, V>> M putAll (
        M map, Iterable<? extends Map<? extends K, ? extends V>> values)
    {
        for (Map<? extends K, ? extends V> val : values) {
            map.putAll(val);
        }
        return map;
    }
288410
public static <K, V> Map<K, V> newCombinedMap(K[] keys,
            V[] values) {
        HashMap<K, V> map = new HashMap<>();
        for (int i = 0; i < keys.length; i++)
            map.put(keys[i], getValueOfIndex(values, i));
        return map;
    }
832958
public static Builder addToSet(String field, Object... values) {
        return new Builder().addToSet(field, values);
    }
608394
public static <K, V> Map<K, V> copyOf(Map<K, V> map) {
        Preconditions.checkNotNull(map);
        return ImmutableMap.<K, V> builder().putAll(map).build();
    }
1168646
def add_fields(self, fields):
        
        for k, v in fields.items():
            if k not in self._fields:
                self._fields[k] = v
56831
public static <K, V> MultiValueMap<K, V> toMultiValueMap(Map<K, List<V>> map) {
		return new MultiValueMapAdapter<K, V>(map);

	}
723455
public static <K, V> HashMap<K, V> newHashMap(K key, V value) {
        HashMap<K, V> map = new HashMap<K, V>();
        map.put(key, value);
        return map;
    }
1369514
private Mapper createMapper(Field field, boolean indexed) {
    lock.lock();
    try {
      Mapper mapper;
      Class<?> fieldType = field.getType();
      Type genericType = field.getGenericType();
      String cacheKey = computeCacheKey(genericType, indexed);
      mapper = cache.get(cacheKey);
      if (mapper != null) {
        return mapper;
      }
      if (List.class.isAssignableFrom(fieldType)) {
        mapper = new ListMapper(genericType, indexed);
      } else if (Set.class.isAssignableFrom(fieldType)) {
        mapper = new SetMapper(genericType, indexed);
      } else {
        // we shouldn't be getting here
        throw new IllegalArgumentException(
            String.format("Field type must be List or Set, found %s", fieldType));
      }
      cache.put(cacheKey, mapper);
      return mapper;
    } finally {
      lock.unlock();
    }
  }
1241133
private Map<String, Object> toFieldsMap(Map<String, DocumentField> fields) {
		Map<String, Object> result = new HashMap<>();
		for (Entry<String, DocumentField> entry : fields.entrySet()) {
			if (entry.getValue().getValues().size() > 1) {
				result.put(entry.getKey(), entry.getValue().getValues());
			} else {
				result.put(entry.getKey(), entry.getValue().getValue());
			}

		}
		return result;
	}
1059660
public static <K, V> KeyValueSink<K, V> asMapSink(ImmutableMultimap.Builder<K, V> multimapB) {
    return new ImmutableMultimapBuilderSink<>(multimapB);
  }
809703
@SuppressWarnings("ConstantConditions")
  private ImmutableBiMap<K,V> toImmutableBiMap() {
    final ImmutableBiMap.Builder<K,V> ret = ImmutableBiMap.builder();

    for (final MapEntry<K, V> entry : entries) {
      ret.put(entry.key, entry.value);
    }

    return ret.build();
  }
793798
public static <K, V> ImmutableMap<K, V> copyOf(Map<? extends K, ? extends V> map) {
    return new ImmutableMap<>(map);
  }
494733
public static <M extends Multimap<?, ?>> MultimapJsonSerializer<M, ?, ?> newInstance( KeySerializer<?> keySerializer,
                                                                                          JsonSerializer<?> valueSerializer ) {
        return new MultimapJsonSerializer( keySerializer, valueSerializer );
    }