29 lines
707 B
Java
29 lines
707 B
Java
package fr.molzonas.painfulloss.enums;
|
|
|
|
import fr.molzonas.painfulloss.PainfulLoss;
|
|
import lombok.Getter;
|
|
|
|
public enum PropertiesEnum {
|
|
LOCALE("locale", PainfulLoss.DEFAULT_LOCALE_TAG),
|
|
DEBUG("debug", "false"),
|
|
PRICE_PROVIDER("priceProvider")
|
|
;
|
|
|
|
@Getter private final String path;
|
|
@Getter private String fallback = null;
|
|
|
|
PropertiesEnum(String path) {
|
|
this.path = path;
|
|
}
|
|
|
|
PropertiesEnum(String path, String fallback) {
|
|
this.path = path;
|
|
this.fallback = fallback;
|
|
}
|
|
|
|
public String getValue() {
|
|
String value = PainfulLoss.getInstance().getConfig().getString(this.getPath());
|
|
return value == null ? fallback : value;
|
|
}
|
|
}
|