Class SimpleFlagRegistry
java.lang.Object
com.sk89q.worldguard.protection.flags.registry.SimpleFlagRegistry
- All Implemented Interfaces:
FlagRegistry,Iterable<Flag<?>>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionFlag<?>Get af flag by its name.getAll()Get all flagsbooleaniterator()voidRegister a new flag.voidregisterAll(Collection<Flag<?>> flags)Register a collection of flags.voidsetInitialized(boolean initialized)intsize()Get the number of registered flags.Unmarshal a raw map of values into a map of flags with their unmarshalled values.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
SimpleFlagRegistry
public SimpleFlagRegistry()
-
-
Method Details
-
isInitialized
public boolean isInitialized() -
setInitialized
public void setInitialized(boolean initialized) -
register
Description copied from interface:FlagRegistryRegister a new flag.There may be an appropriate time to register flags. If flags are registered outside this time, then an exception may be thrown.
- Specified by:
registerin interfaceFlagRegistry- Parameters:
flag- The flag- Throws:
FlagConflictException- Thrown when an existing flag exists with the same name
-
registerAll
Description copied from interface:FlagRegistryRegister a collection of flags.There may be an appropriate time to register flags. If flags are registered outside this time, then an exception may be thrown.
If there is a flag conflict, then an error will be logged but no exception will be thrown.
- Specified by:
registerAllin interfaceFlagRegistry- Parameters:
flags- a collection of flags
-
get
Description copied from interface:FlagRegistryGet af flag by its name.- Specified by:
getin interfaceFlagRegistry- Parameters:
name- The name- Returns:
- The flag, if it has been registered
-
getAll
Description copied from interface:FlagRegistryGet all flags- Specified by:
getAllin interfaceFlagRegistry- Returns:
- All flags
-
unmarshal
Description copied from interface:FlagRegistryUnmarshal a raw map of values into a map of flags with their unmarshalled values.- Specified by:
unmarshalin interfaceFlagRegistry- Parameters:
rawValues- The raw values mapcreateUnknown- Whether "just in time" flags should be created for unknown flags- Returns:
- The unmarshalled flag values map
-
size
public int size()Description copied from interface:FlagRegistryGet the number of registered flags.- Specified by:
sizein interfaceFlagRegistry- Returns:
- The number of registered flags
-
iterator
-