use of com.google.api.codegen.configgen.nodes.metadata.DefaultComment in project toolkit by googleapis.
the class CollectionMerger method generateCollectionsNode.
public ConfigNode generateCollectionsNode(ConfigNode prevNode, Map<String, String> nameMap) {
FieldConfigNode collectionsNode = new FieldConfigNode(NodeFinder.getNextLine(prevNode), "collections").setComment(new DefaultComment(COLLECTIONS_COMMENT));
prevNode.insertNext(collectionsNode);
ListTransformer.generateList(nameMap.entrySet(), collectionsNode, (startLine, entry) -> generateCollectionNode(startLine, entry.getKey(), entry.getValue()));
return collectionsNode;
}
use of com.google.api.codegen.configgen.nodes.metadata.DefaultComment in project toolkit by googleapis.
the class InterfaceMerger method mergeInterfaces.
public void mergeInterfaces(ApiModel model, ConfigNode configNode) {
FieldConfigNode interfacesNode = MissingFieldTransformer.append("interfaces", configNode).generate();
if (NodeFinder.hasContent(interfacesNode.getChild())) {
return;
}
ConfigNode interfacesValueNode = ListTransformer.generateList(model.getInterfaces(), interfacesNode, this::generateInterfaceNode);
interfacesNode.setChild(interfacesValueNode).setComment(new DefaultComment("A list of API interface configurations."));
}
use of com.google.api.codegen.configgen.nodes.metadata.DefaultComment in project toolkit by googleapis.
the class RetryMerger method generateRetryDefinitionsNode.
public ConfigNode generateRetryDefinitionsNode(ConfigNode prevNode) {
FieldConfigNode retryCodesDefNode = new FieldConfigNode(NodeFinder.getNextLine(prevNode), "retry_codes_def").setComment(new DefaultComment("Definition for retryable codes."));
prevNode.insertNext(retryCodesDefNode);
generateRetryCodesDefValueNode(retryCodesDefNode);
FieldConfigNode retryParamsDefNode = new FieldConfigNode(NodeFinder.getNextLine(retryCodesDefNode), "retry_params_def").setComment(new DefaultComment("Definition for retry/backoff parameters."));
retryCodesDefNode.insertNext(retryParamsDefNode);
generateRetryParamsDefValueNode(retryParamsDefNode);
return retryParamsDefNode;
}
use of com.google.api.codegen.configgen.nodes.metadata.DefaultComment in project toolkit by googleapis.
the class ListItemConfigNodeTest method testComment.
@Test
public void testComment() throws Exception {
ListItemConfigNode node = new ListItemConfigNode(0);
Comment comment = new DefaultComment("Lorem ispum");
Truth.assertThat(node.getComment().generate()).isEqualTo("");
Truth.assertThat(node.setComment(comment)).isSameAs(node);
Truth.assertThat(node.getComment()).isSameAs(comment);
}
Aggregations