Class PairedConfigBuilder<K>

java.lang.Object
me.a8kj.config.builder.PairedConfigBuilder<K>
Type Parameters:
K - the type of keys used in the paired data memory.

public class PairedConfigBuilder<K> extends Object
A specialized builder class for creating ConfigFile instances that utilize PairedDataMemory. This builder is designed for configurations that require a key-value mapping structure in memory.
Since:
0.1
Author:
a8kj7sea
  • Method Details

    • of

      public static <T> PairedConfigBuilder<T> of(Class<T> keyType)
      Static factory method to initiate the paired builder with a specific key type.
      Type Parameters:
      T - the type of keys for the new builder.
      Parameters:
      keyType - the class representing the key type.
      Returns:
      a new instance of PairedConfigBuilder.
      Since:
      0.1
    • meta

      public PairedConfigBuilder<K> meta(ConfigMeta meta)
      Sets the metadata for the configuration, containing identifying information and paths.
      Parameters:
      meta - the ConfigMeta instance.
      Returns:
      the current builder instance for chaining.
      Since:
      0.1
    • at

      public PairedConfigBuilder<K> at(PathProvider pathProvider)
      Sets the path provider used to determine the storage location of the configuration file.
      Parameters:
      pathProvider - the PathProvider instance.
      Returns:
      the current builder instance for chaining.
      Since:
      0.1
    • memory

      public PairedConfigBuilder<K> memory(PairedDataMemory<K> memory)
      Sets the paired data memory implementation for managing key-value configuration data.
      Parameters:
      memory - the PairedDataMemory instance.
      Returns:
      the current builder instance for chaining.
      Since:
      0.1
    • build

      public ConfigFile<K> build()
      Validates all required components and creates a new ConfigFile instance.
      Returns:
      a fully initialized ConfigFile using paired memory.
      Throws:
      NullPointerException - if meta, memory, or pathProvider are not initialized.
      Since:
      0.1