Package me.croabeast.file
Interface SectionMappable<C extends Collection<org.bukkit.configuration.ConfigurationSection>,S extends SectionMappable<C,S>>
- Type Parameters:
C- the type of collection that holdsConfigurationSectionelementsS- the type of the implementingSectionMappableinstance
- All Superinterfaces:
BaseBuilder<S>,Copyable<S>,Iterable<Map.Entry<Integer,,C>> Map<Integer,,C> Mappable<org.bukkit.configuration.ConfigurationSection,C, S>
- All Known Subinterfaces:
SectionMappable.List,SectionMappable.Set
public interface SectionMappable<C extends Collection<org.bukkit.configuration.ConfigurationSection>,S extends SectionMappable<C,S>>
extends Mappable<org.bukkit.configuration.ConfigurationSection,C,S>
Represents a specialized
Mappable for mapping integer keys to collections of
ConfigurationSection objects.
SectionMappable provides a framework for organizing configuration sections by numeric keys,
along with utility methods to convert the stored values into more specific data structures such as sets
or lists. It is designed to be implemented by a concrete class to ensure full functionality, such as
correctly handling storage and retrieval of configuration sections.
Note: While the base SectionMappable interface must be implemented for full
functionality, its nested sub-interfaces SectionMappable.Set and SectionMappable.List do not
require separate implementations. They can be directly instantiated using the provided static factory methods
asSet(Map) and asList(Map), which return ready-to-use instances.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceRepresents aSectionMappableimplementation backed by aList.static interfaceRepresents aSectionMappableimplementation backed by aSet.Nested classes/interfaces inherited from interface me.croabeast.file.Mappable
Mappable.BaseList<T,B extends Mappable.BaseList<T, B>>, Mappable.BaseSet<T, B extends Mappable.BaseSet<T, B>> -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic SectionMappable.ListasList()Creates an emptySectionMappable.Listinstance.static SectionMappable.ListCreates aSectionMappable.Listinstance from the given map.static SectionMappable.SetasSet()Creates an emptySectionMappable.Setinstance.static SectionMappable.SetCreates aSectionMappable.Setinstance from the given map.Methods inherited from interface me.croabeast.common.builder.BaseBuilder
instanceMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuesMethods inherited from interface me.croabeast.file.Mappable
filter, getStoredValues, getStoredValues, iterator, order, order
-
Method Details
-
asSet
static SectionMappable.Set asSet(Map<Integer, Set<org.bukkit.configuration.ConfigurationSection>> map) Creates aSectionMappable.Setinstance from the given map.- Parameters:
map- a map with integer keys and sets ofConfigurationSectionas values- Returns:
- a new instance of
SectionMappable.Setpopulated with the given map
-
asSet
Creates an emptySectionMappable.Setinstance.- Returns:
- a new empty instance of
SectionMappable.Set
-
asList
static SectionMappable.List asList(Map<Integer, List<org.bukkit.configuration.ConfigurationSection>> map) Creates aSectionMappable.Listinstance from the given map.- Parameters:
map- a map with integer keys and lists ofConfigurationSectionas values- Returns:
- a new instance of
SectionMappable.Listpopulated with the given map
-
asList
Creates an emptySectionMappable.Listinstance.- Returns:
- a new empty instance of
SectionMappable.List
-