Last active
October 15, 2020 12:07
-
-
Save barancev/2e59e25e37977120b7505a287e7d4cb8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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