Skip to content

Commit

Permalink
fix: clean up composer methods (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
miraleung authored Jul 25, 2020
1 parent 2c84260 commit be7d87c
Showing 1 changed file with 2 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public static List<GapicClass> generateServiceClasses(
public static List<GapicClass> generateStubClasses(
Service service, Map<String, Message> messageTypes) {
List<GapicClass> clazzes = new ArrayList<>();
clazzes.add(generateStubServiceStub(service, messageTypes));
clazzes.add(ServiceStubClassComposer.instance().generate(service, messageTypes));
clazzes.add(generateStubServiceSettings(service));
clazzes.add(GrpcServiceCallableFactoryClassComposer.instance().generate(service, messageTypes));
clazzes.add(GrpcServiceStubClassComposer.instance().generate(service, messageTypes));
Expand All @@ -58,7 +58,7 @@ public static List<GapicClass> generateStubClasses(
public static List<GapicClass> generateClientSettingsClasses(
Service service, Map<String, Message> messageTypes) {
List<GapicClass> clazzes = new ArrayList<>();
clazzes.add(generateServiceClient(service, messageTypes));
clazzes.add(ServiceClientClassComposer.instance().generate(service, messageTypes));
clazzes.add(generateServiceSettings(service));
return clazzes;
}
Expand All @@ -72,22 +72,12 @@ public static List<GapicClass> generateMocksAndTestClasses(
}

/** ====================== STUB CLASSES ==================== */
private static GapicClass generateStubServiceStub(
Service service, Map<String, Message> messageTypes) {
return ServiceStubClassComposer.instance().generate(service, messageTypes);
}

private static GapicClass generateStubServiceSettings(Service service) {
return generateGenericClass(
Kind.STUB, String.format("%sStubSettings", service.name()), service);
}

/** ====================== MAIN CLASSES ==================== */
private static GapicClass generateServiceClient(
Service service, Map<String, Message> messageTypes) {
return ServiceClientClassComposer.instance().generate(service, messageTypes);
}

private static GapicClass generateServiceSettings(Service service) {
return generateGenericClass(Kind.MAIN, String.format("%sSettings", service.name()), service);
}
Expand Down

0 comments on commit be7d87c

Please sign in to comment.