Skip to content

Instantly share code, notes, and snippets.

@barancev
Last active October 15, 2020 12:07
Show Gist options
  • Save barancev/2e59e25e37977120b7505a287e7d4cb8 to your computer and use it in GitHub Desktop.
Save barancev/2e59e25e37977120b7505a287e7d4cb8 to your computer and use it in GitHub Desktop.
package xxx;
import static xxx.Section.PHOTOS;
import static xxx.Section.WALL;
public enum MethodAPI {
WALL_POST(WALL, "post"),
WALL_POST_EDIT(WALL, "edit"),
PHOTOS_UPLOAD_WALL(PHOTOS, "setWallUploadServer"),
PHOTOS_SAVE_WALL(PHOTOS, "saveWallPhoto");
private final Section section;
private final String methodName;
MethodAPI(Section section, String methodName) {
this.section = section;
this.methodName = methodName;
}
public String getMethod() {
return String.join(".", section.getName(), methodName);
}
}
package xxx;
public enum Section {
WALL("wall"),
PHOTOS("photos");
private final String name;
Section(String name) {
this.name = name;
}
public String getName() {
return name;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment