package net.knarcraft.paidsigns.property; /** * A representation of a paid sign condition's editable properties */ public enum PaidSignConditionProperty { /** * The string used to trigger the paid sign condition */ STRING_TO_MATCH("stringToMatch"), /** * Whether to execute the match string as a regular expression */ EXECUTE_REG_EX("executeRegEx"), /** * Whether to ignore case for the sign condition */ IGNORE_CASE("ignoreCase"), /** * Whether to ignore color for the sign condition */ IGNORE_COLOR("ignoreColor"); private final String stringRepresentation; /** * Instantiates a new paid sign condition property * * @param stringRepresentation
The string representation of the paid sign condition property
*/ PaidSignConditionProperty(String stringRepresentation) { this.stringRepresentation = stringRepresentation; } /** * Gets the string representation of this paid sign condition property * * @returnThe string representation of this paid sign condition property
*/ public String getStringRepresentation() { return this.stringRepresentation; } /** * Gets the paid sign property matching the given string * * @param propertyStringThe string representing a paid sign condition property
* @returnThe matching paid sign condition property, or null if no such property exists
*/ public static PaidSignConditionProperty getFromString(String propertyString) { for (PaidSignConditionProperty paidSignProperty : PaidSignConditionProperty.values()) { if (paidSignProperty.getStringRepresentation().equalsIgnoreCase(propertyString)) { return paidSignProperty; } } return null; } }