@Override @Nonnull public List<? extends SoyValueProvider> asJavaList() { return asList(); }
@Override @Nonnull public List<? extends SoyValue> asResolvedJavaList() { return asList(); }
@Override @Nonnull public List<? extends SoyValueProvider> asJavaList() { return asList(); }
@Override @Nonnull public List<? extends SoyValue> asResolvedJavaList() { return asList(); }
/** * Private helper for {@code asMap()} to add a map (or submap) to the combined map data. * @param combinedMapData The combined map data that we're building. * @param keyPrefix The key prefix if adding a submap (or empty string if adding one of the * top-level maps: the base data or the augmented data). * @param map The map of data to add. */ private static void addMapDataHelper( SoyMapData combinedMapData, String keyPrefix, Map<String, SoyData> map) { for (Map.Entry<String, SoyData> entry : map.entrySet()) { String key = entry.getKey(); SoyData value = entry.getValue(); if (value instanceof SoyMapData) { addMapDataHelper(combinedMapData, keyPrefix + key + ".", ((SoyMapData) value).asMap()); } else if (value instanceof SoyListData) { addListDataHelper(combinedMapData, keyPrefix + key + ".", ((SoyListData) value).asList()); } else { combinedMapData.put(keyPrefix + key, value); } } }
/** * Private helper for {@code asMap()} to add a sublist to the combined map data. * @param combinedMapData The combined map data that we're building. * @param keyPrefix The key prefix for this sublist. * @param list The list of data to add. */ private static void addListDataHelper( SoyMapData combinedMapData, String keyPrefix, List<SoyData> list) { for (int i = 0; i < list.size(); ++i) { SoyData el = list.get(i); if (el instanceof SoyMapData) { addMapDataHelper(combinedMapData, keyPrefix + i + ".", ((SoyMapData) el).asMap()); } else if (el instanceof SoyListData) { addListDataHelper(combinedMapData, keyPrefix + i + ".", ((SoyListData) el).asList()); } else { combinedMapData.put(keyPrefix + i, el); } } }
return Lists.transform(((SoyListData) data).asList(), new Function<SoyData, Object>()