Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ggj][resname] fix: Fix resname helper method names for of* and format* #408

Merged
merged 13 commits into from
Oct 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,8 @@ private static List<MethodDefinition> createOfOrFormatMethodHelper(
.setReturnType(returnType)
.setName(
String.format(
methodNameFormat, i == 0 ? "" : getBuilderTypeName(tokenHierarchies, i)))
methodNameFormat,
i == 0 ? "" : concatToUpperCamelCaseName(tokenHierarchies.get(i)) + "Name"))
.setArguments(methodArgs)
.setReturnExpr(returnExpr)
.build());
Expand All @@ -537,7 +538,10 @@ private static List<MethodDefinition> createOfOrFormatMethodHelper(
.setIsStatic(true)
.setAnnotations(annotations)
.setReturnType(returnType)
.setName(String.format(methodNameFormat, getBuilderTypeName(tokens)))
.setName(
String.format(
methodNameFormat,
concatToUpperCamelCaseName(tokenHierarchies.get(i)) + "Name"))
.setArguments(methodArgs)
.setReturnExpr(returnExpr)
.build());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,12 @@ public class FoobarName implements ResourceName {
}

@BetaApi("The static create methods are not stable yet and may be changed in the future.")
public static FoobarName ofProjectFoobarBuilder(String project, String foobar) {
public static FoobarName ofProjectFoobarName(String project, String foobar) {
return newBuilder().setProject(project).setFoobar(foobar).build();
}

@BetaApi("The static create methods are not stable yet and may be changed in the future.")
public static FoobarName ofProjectVariantFoobarBuilder(
public static FoobarName ofProjectVariantFoobarName(
String project, String variant, String foobar) {
return newProjectVariantFoobarBuilder()
.setProject(project)
Expand All @@ -128,12 +128,12 @@ public class FoobarName implements ResourceName {
}

@BetaApi("The static create methods are not stable yet and may be changed in the future.")
public static FoobarName ofFoobarBuilder(String foobar) {
public static FoobarName ofFoobarName(String foobar) {
return newFoobarBuilder().setFoobar(foobar).build();
}

@BetaApi("The static create methods are not stable yet and may be changed in the future.")
public static FoobarName ofBarFooFoobarBuilder(String barFoo, String foobar) {
public static FoobarName ofBarFooFoobarName(String barFoo, String foobar) {
return newBarFooFoobarBuilder().setBarFoo(barFoo).setFoobar(foobar).build();
}

Expand All @@ -142,12 +142,12 @@ public class FoobarName implements ResourceName {
}

@BetaApi("The static format methods are not stable yet and may be changed in the future.")
public static String formatProjectFoobarBuilder(String project, String foobar) {
public static String formatProjectFoobarName(String project, String foobar) {
return newBuilder().setProject(project).setFoobar(foobar).build().toString();
}

@BetaApi("The static format methods are not stable yet and may be changed in the future.")
public static String formatProjectVariantFoobarBuilder(
public static String formatProjectVariantFoobarName(
String project, String variant, String foobar) {
return newProjectVariantFoobarBuilder()
.setProject(project)
Expand All @@ -158,12 +158,12 @@ public class FoobarName implements ResourceName {
}

@BetaApi("The static format methods are not stable yet and may be changed in the future.")
public static String formatFoobarBuilder(String foobar) {
public static String formatFoobarName(String foobar) {
return newFoobarBuilder().setFoobar(foobar).build().toString();
}

@BetaApi("The static format methods are not stable yet and may be changed in the future.")
public static String formatBarFooFoobarBuilder(String barFoo, String foobar) {
public static String formatBarFooFoobarName(String barFoo, String foobar) {
return newBarFooFoobarBuilder().setBarFoo(barFoo).setFoobar(foobar).build().toString();
}

Expand Down