TFGuilds/src/main/java/me/totalfreedom/tfguilds/guild/GuildState.java

38 lines
775 B
Java
Raw Normal View History

2020-07-13 00:40:11 +00:00
package me.totalfreedom.tfguilds.guild;
import lombok.Getter;
public enum GuildState
{
OPEN("Open"),
INVITE_ONLY("Invite-only"),
CLOSED("Closed");
@Getter
private final String display;
GuildState(String display)
{
this.display = display;
}
public static GuildState findState(String string)
{
2020-07-16 21:33:13 +00:00
if (string == null)
return null;
2020-07-13 00:40:11 +00:00
switch (string.toLowerCase())
{
case "open":
case "opened":
return OPEN;
case "invite":
case "inviteonly":
case "invite_only":
return INVITE_ONLY;
case "closed":
case "close":
return CLOSED;
}
return null;
}
}