Class SetFlag<T>

java.lang.Object
com.sk89q.worldguard.protection.flags.Flag<Set<T>>
com.sk89q.worldguard.protection.flags.SetFlag<T>

public class SetFlag<T> extends Flag<Set<T>>
Stores a set of types.
  • Constructor Details

  • Method Details

    • getType

      public Flag<T> getType()
      Get the flag that is stored in this flag.
      Returns:
      the stored flag type
    • parseInput

      public Set<T> parseInput(FlagContext context) throws InvalidFlagFormat
      Description copied from class: Flag
      Parse a given input to coerce it to a type compatible with the flag.
      Specified by:
      parseInput in class Flag<Set<T>>
      Parameters:
      context - the FlagContext
      Returns:
      The coerced type
      Throws:
      InvalidFlagFormat - Raised if the input is invalid
    • unmarshal

      public Set<T> unmarshal(Object o)
      Description copied from class: Flag
      Convert a raw type that was loaded (from a YAML file, for example) into the type that this flag uses.
      Specified by:
      unmarshal in class Flag<Set<T>>
      Parameters:
      o - The object
      Returns:
      The unmarshalled type
    • marshal

      public Object marshal(Set<T> o)
      Description copied from class: Flag
      Convert the value stored for this flag into a type that can be serialized into YAML.
      Specified by:
      marshal in class Flag<Set<T>>
      Parameters:
      o - The object
      Returns:
      The marshalled type