-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor DonationType to something sane, i guess
- Loading branch information
1 parent
6e738b8
commit 44df4a8
Showing
1 changed file
with
14 additions
and
63 deletions.
There are no files selected for viewing
77 changes: 14 additions & 63 deletions
77
bukkit/src/main/java/net/leaderos/plugin/modules/donations/model/DonationType.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,24 @@ | ||
package net.leaderos.plugin.modules.donations.model; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
/** | ||
* @author poyrazinan | ||
* @author poyrazinan, efekurbann | ||
* @since 1.0 | ||
*/ | ||
@AllArgsConstructor | ||
@Getter | ||
public enum DonationType { | ||
LATEST, | ||
TOP_ALLTIME, | ||
TOP_ANNUAL, | ||
TOP_MONTHLY, | ||
TOP_DAILY; | ||
|
||
/** | ||
* Gets request type string | ||
* @return String of request | ||
*/ | ||
public String getRequest() { | ||
switch (this) { | ||
case LATEST: | ||
return "latest"; | ||
case TOP_ALLTIME: | ||
return "top-alltime"; | ||
case TOP_ANNUAL: | ||
return "top-annual"; | ||
case TOP_MONTHLY: | ||
return "top-monthly"; | ||
case TOP_DAILY: | ||
return "top-daily"; | ||
} | ||
return null; | ||
} | ||
LATEST("latest", 'l', '1'), | ||
TOP_ALLTIME("top-alltime", 'a', '2'), | ||
TOP_ANNUAL("top-annual", 'y', '3'), | ||
TOP_MONTHLY("top-monthly", 'm', '4'), | ||
TOP_DAILY("top-daily", 'd', '5'); | ||
|
||
/** | ||
* Gets gui char | ||
* @return char of gui | ||
*/ | ||
public char getGuiChar() { | ||
switch (this) { | ||
case LATEST: | ||
return 'l'; | ||
case TOP_ALLTIME: | ||
return 'a'; | ||
case TOP_ANNUAL: | ||
return 'y'; | ||
case TOP_MONTHLY: | ||
return 'm'; | ||
case TOP_DAILY: | ||
return 'd'; | ||
} | ||
return 'l'; | ||
} | ||
private final String request; | ||
private final char guiChar; | ||
private final char guiInfoChar; | ||
|
||
/** | ||
* Gets gui info char | ||
* @return char of gui info | ||
*/ | ||
public char getGuiInfoChar() { | ||
switch (this) { | ||
case LATEST: | ||
return '1'; | ||
case TOP_ALLTIME: | ||
return '2'; | ||
case TOP_ANNUAL: | ||
return '3'; | ||
case TOP_MONTHLY: | ||
return '4'; | ||
case TOP_DAILY: | ||
return '5'; | ||
} | ||
return '1'; | ||
} | ||
} |