use of com.google.api.codegen.config.SingleResourceNameConfig in project toolkit by googleapis.
the class InitCodeTransformer method createCollectionMap.
/**
* A utility method which creates the InitValueConfig map that contains the collection config
* data.
*/
public static ImmutableMap<String, InitValueConfig> createCollectionMap(MethodContext context) {
ImmutableMap.Builder<String, InitValueConfig> mapBuilder = ImmutableMap.builder();
Map<String, String> fieldNamePatterns = context.getFieldResourceEntityMap();
for (Map.Entry<String, String> fieldNamePattern : fieldNamePatterns.entrySet()) {
SingleResourceNameConfig resourceNameConfig = context.getSingleResourceNameConfig(fieldNamePattern.getValue());
String apiWrapperClassName = context.getNamer().getApiWrapperClassName(context.getInterfaceConfig());
InitValueConfig initValueConfig = InitValueConfig.create(apiWrapperClassName, resourceNameConfig);
mapBuilder.put(fieldNamePattern.getKey(), initValueConfig);
}
return mapBuilder.build();
}
Aggregations