Package de.z0rdak.yawp.core.flag
Class RegionFlags
java.lang.Object
de.z0rdak.yawp.core.flag.RegionFlags
- All Implemented Interfaces:
IFlagContainer
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()booleanChecks if a flag with the given name exists in the container.Retrieves a set of all flag entries in the container.flags()Retrieves all flags stored in the container.Retrieves all flags that match the specified state.Retrieves theFlagStateof a specified flag within this region.Retrieves the flag associated with the given name.booleanisEmpty()booleanisFlagDefined(@NotNull String flagName) Checks whether the specified flag is defined (i.e., notUNDEFINED).booleanChecks if a flag with the given name is set (i.e., its state is eitherFlagState.ALLOWEDorFlagState.DENIED).voidvoidintsize()
-
Field Details
-
CODEC
-
-
Constructor Details
-
RegionFlags
public RegionFlags() -
RegionFlags
-
-
Method Details
-
put
- Specified by:
putin interfaceIFlagContainer
-
get
Description copied from interface:IFlagContainerRetrieves the flag associated with the given name.- Specified by:
getin interfaceIFlagContainer- Parameters:
flagName- the name of the flag- Returns:
- the corresponding
IFlag, ornullif not found
-
remove
- Specified by:
removein interfaceIFlagContainer
-
contains
Description copied from interface:IFlagContainerChecks if a flag with the given name exists in the container.- Specified by:
containsin interfaceIFlagContainer- Parameters:
flag- the name of the flag to check- Returns:
trueif the flag exists, otherwisefalse
-
clear
public void clear()- Specified by:
clearin interfaceIFlagContainer
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceIFlagContainer
-
size
public int size()- Specified by:
sizein interfaceIFlagContainer
-
flagEntries
Description copied from interface:IFlagContainerRetrieves a set of all flag entries in the container.- Specified by:
flagEntriesin interfaceIFlagContainer- Returns:
- a set of
Map.Entrypairs, where the key is the flag name and the value is the correspondingIFlag
-
flags
Description copied from interface:IFlagContainerRetrieves all flags stored in the container.- Specified by:
flagsin interfaceIFlagContainer- Returns:
- a list of all
IFlagobjects in the container
-
flags
Description copied from interface:IFlagContainerRetrieves all flags that match the specified state.- Specified by:
flagsin interfaceIFlagContainer- Parameters:
state- theFlagStateto filter by- Returns:
- a list of
IFlagobjects that have the specified state
-
flagState
Retrieves theFlagStateof a specified flag within this region.Since
RegionFlagsdoes not allow null values, anullflag is treated asFlagState.UNDEFINED. If the flag exists in the region, its state is returned. Otherwise, the method returnsFlagState.UNDEFINED.- Specified by:
flagStatein interfaceIFlagContainer- Parameters:
flagName- the name of the flag to check- Returns:
- the
FlagStateof the specified flag, orFlagState.UNDEFINEDif the flag is not present
-
isFlagDefined
Description copied from interface:IFlagContainerChecks whether the specified flag is defined (i.e., notUNDEFINED).- Specified by:
isFlagDefinedin interfaceIFlagContainer- Parameters:
flagName- the flag to check, must not benull- Returns:
trueif the flag is defined, otherwisefalse
-
isSet
Description copied from interface:IFlagContainerChecks if a flag with the given name is set (i.e., its state is eitherFlagState.ALLOWEDorFlagState.DENIED).- Specified by:
isSetin interfaceIFlagContainer- Parameters:
flagName- the name of the flag to check- Returns:
trueif the flag is set, otherwisefalse
-
getActiveFlags
-
getFlagMap
-