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 flagsboolean
iterator()
void
Register a new flag.void
registerAll
(Collection<Flag<?>> flags) Register a collection of flags.void
setInitialized
(boolean initialized) int
size()
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, wait
Methods 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:FlagRegistry
Register 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:
register
in interfaceFlagRegistry
- Parameters:
flag
- The flag- Throws:
FlagConflictException
- Thrown when an existing flag exists with the same name
-
registerAll
Description copied from interface:FlagRegistry
Register 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:
registerAll
in interfaceFlagRegistry
- Parameters:
flags
- a collection of flags
-
get
Description copied from interface:FlagRegistry
Get af flag by its name.- Specified by:
get
in interfaceFlagRegistry
- Parameters:
name
- The name- Returns:
- The flag, if it has been registered
-
getAll
Description copied from interface:FlagRegistry
Get all flags- Specified by:
getAll
in interfaceFlagRegistry
- Returns:
- All flags
-
unmarshal
Description copied from interface:FlagRegistry
Unmarshal a raw map of values into a map of flags with their unmarshalled values.- Specified by:
unmarshal
in 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:FlagRegistry
Get the number of registered flags.- Specified by:
size
in interfaceFlagRegistry
- Returns:
- The number of registered flags
-
iterator
-