Interface FlagContainer

    • Method Detail

      • getParentContainer

        @Nullable FlagContainer getParentContainer()
        Return the parent container (if the container has a parent)
        Parent container, if it exists
      • setParentContainer

        void setParentContainer​(FlagContainer parentContainer)
      • getInternalPlotFlagMap

        Map<Class<?>,​WorldFlag<?,​?>> getInternalPlotFlagMap()
      • getFlagMap

        Map<Class<?>,​WorldFlag<?,​?>> getFlagMap()
        Get an immutable view of the underlying flag map
        Immutable flag map
      • addFlag

        <V,​T extends WorldFlag<V,​?>> void addFlag​(T flag)
        Add a flag to the container
        flag - Flag to add
        See Also:
        to add multiple flags
      • removeFlag

        <V,​T extends WorldFlag<V,​?>> V removeFlag​(T flag)
        Remove a flag from the container
        flag - Flag to remove
      • clearLocal

        void clearLocal()
        Clears the local flag map
      • getRecognizedPlotFlags

        Collection<WorldFlag<?,​?>> getRecognizedPlotFlags()
        Get a collection of all recognized world flags. Will by default use the values contained in GlobalWorldFlagContainer.
        All recognized flag types
      • getHighestClassContainer

        FlagContainer getHighestClassContainer()
        Recursively seek for the highest order flag container. This will by default return GlobalWorldFlagContainer.
        Highest order class container.
      • getFlagErased

        WorldFlag<?,​?> getFlagErased​(Class<?> flagClass)
        Has the same functionality as getFlag(Class), but with wildcard generic types.
        flagClass - The WorldFlag class.
      • getFlag

        <V,​T extends WorldFlag<V,​?>> T getFlag​(Class<? extends T> flagClass)
        Query all levels of flag containers for a flag. This guarantees that a flag instance is returned, as long as it is registered in the global flag container.
        Type Parameters:
        V - Flag value type
        T - Flag type
        flagClass - Flag class to query for
        Flag instance
      • queryLocal

        <V,​T extends WorldFlag<V,​?>> T queryLocal​(Class<?> flagClass)
        Check for flag existence in this flag container instance.
        Type Parameters:
        V - Flag value type
        T - Flag type
        flagClass - Flag class to query for
        The flag instance, if it exists in this container, else null.
      • subscribe

        void subscribe​(@NotNull
                       FlagContainer.WorldFlagUpdateHandler worldFlagUpdateHandler)
        Subscribe to flag updates in this particular flag container instance. Updates are: a flag being removed, a flag being added or a flag being updated.
        worldFlagUpdateHandler - The update handler which will react to changes.
        See Also:
        World flag update types
      • addUnknownFlag

        void addUnknownFlag​(String flagName,
                            String value)
        Register a flag key-value pair which cannot yet be associated with an existing flag instance (such as when third party flag values are loaded before the flag type has been registered).

        These values will be registered in the flag container if the associated flag type is registered in the top level flag container.

        flagName - Flag name
        value - Flag value