/** Combine the two maps. */ public static SoyDict augmentMap(SoyDict first, SoyDict second) { Map<String, SoyValueProvider> map = Maps.newHashMapWithExpectedSize(first.getItemCnt() + second.getItemCnt()); map.putAll(first.asJavaStringMap()); map.putAll(second.asJavaStringMap()); return DictImpl.forProviderMap(map, RuntimeType.LEGACY_OBJECT_MAP_OR_RECORD); }
/** * Combine the two maps -- for the JavaSource variant while the function signature is still ? * instead of map. */ public static SoyDict augmentMap(SoyValue sv1, SoyValue sv2) { SoyDict first = (SoyDict) sv1; SoyDict second = (SoyDict) sv2; Map<String, SoyValueProvider> map = Maps.newHashMapWithExpectedSize(first.getItemCnt() + second.getItemCnt()); map.putAll(first.asJavaStringMap()); map.putAll(second.asJavaStringMap()); return DictImpl.forProviderMap(map, RuntimeMapTypeTracker.Type.LEGACY_OBJECT_MAP_OR_RECORD); }