Skip to content

Commit

Permalink
refactor DonationType to something sane, i guess
Browse files Browse the repository at this point in the history
  • Loading branch information
efekurbann committed Jan 15, 2024
1 parent 6e738b8 commit 44df4a8
Showing 1 changed file with 14 additions and 63 deletions.
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';
}
}

0 comments on commit 44df4a8

Please sign in to comment.