public class EnumFlag<T extends Enum<T>> extends Flag<T>
| Constructor and Description |
|---|
EnumFlag(String name,
Class<T> enumClass) |
EnumFlag(String name,
Class<T> enumClass,
RegionGroup defaultGroup) |
| Modifier and Type | Method and Description |
|---|---|
T |
detectValue(String input)
Fuzzy detect the value if the value is not found.
|
Class<T> |
getEnumClass()
Get the enum class.
|
Object |
marshal(T o)
Convert the value stored for this flag into a type that can be
serialized into YAML.
|
T |
parseInput(WorldGuardPlugin plugin,
org.bukkit.command.CommandSender sender,
String input)
Parse a given input to coerce it to a type compatible with the flag.
|
T |
unmarshal(Object o)
Convert a raw type that was loaded (from a YAML file, for example)
into the type that this flag uses.
|
chooseValue, getDefault, getName, getRegionGroupFlag, hasConflictStrategy, implicitlySetWithMembership, requiresSubject, toString, usesMembershipAsDefaultpublic EnumFlag(String name, Class<T> enumClass, RegionGroup defaultGroup)
public T detectValue(String input)
input - string inputpublic T parseInput(WorldGuardPlugin plugin, org.bukkit.command.CommandSender sender, String input) throws InvalidFlagFormat
FlagparseInput in class Flag<T extends Enum<T>>plugin - The pluginsender - The senderinput - THe inputInvalidFlagFormat - Raised if the input is invalidpublic T unmarshal(Object o)
FlagCopyright © 2015. All Rights Reserved.