Skip to content

Commit

Permalink
simplify the input parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
summer-ji-eng committed Nov 18, 2020
1 parent e5e6014 commit 260d668
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ static List<CommentStatement> createClassHeaderComments(
classHeaderJavadocBuilder.addParagraph(SERVICE_DESCRIPTION_ENDPOINT_SUMMARY_STRING);
classHeaderJavadocBuilder.addSampleCode(
ServiceClientSampleCodeComposer.composeClassHeaderEndpointSampleCode(
clientName, clientType, settingsName, settingsType));
clientType, settingsType));

return Arrays.asList(
CommentComposer.AUTO_GENERATED_CLASS_COMMENT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,11 @@ public static String composeClassHeaderCredentialsSampleCode(
}

public static String composeClassHeaderEndpointSampleCode(
String clientName, TypeNode clientType, String settingsName, TypeNode settingsType) {
TypeNode clientType, TypeNode settingsType) {
// Initialize client settings with builder() method.
// e.g. EchoSettings echoSettings = EchoSettings.newBuilder().setEndpoint("myEndpoint").build();
String settingsName = JavaStyle.toLowerCamelCase(settingsType.reference().name());
String clientName = JavaStyle.toLowerCamelCase(clientType.reference().name());
VariableExpr settingsVarExpr = createVariableExpr(settingsName, settingsType);
MethodInvocationExpr newBuilderMethodExpr =
MethodInvocationExpr.builder()
Expand Down

0 comments on commit 260d668

Please sign in to comment.