Class MapFlag<K,V>

java.lang.Object
com.sk89q.worldguard.protection.flags.Flag<Map<K,V>>
com.sk89q.worldguard.protection.flags.MapFlag<K,V>

public class MapFlag<K,V> extends Flag<Map<K,V>>
Stores a key value map of typed Flags.
  • Constructor Details

  • Method Details

    • getKeyFlag

      public Flag<K> getKeyFlag()
      Get the flag that is stored as the key flag type.
      Returns:
      The key flag type.
    • getValueFlag

      public Flag<V> getValueFlag()
      Get the flag type that is stored as values.
      Returns:
      The value flag type.
    • parseInput

      public Map<K,V> 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<Map<K,V>>
      Parameters:
      context - the FlagContext
      Returns:
      The coerced type
      Throws:
      InvalidFlagFormat - Raised if the input is invalid
    • unmarshal

      public Map<K,V> unmarshal(@Nullable 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<Map<K,V>>
      Parameters:
      o - The object
      Returns:
      The unmarshalled type
    • marshal

      public Object marshal(Map<K,V> 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<Map<K,V>>
      Parameters:
      o - The object
      Returns:
      The marshalled type