Package de.bsommerfeld.jshepherd.core
Class ConfigurationLoader
java.lang.Object
de.bsommerfeld.jshepherd.core.ConfigurationLoader
Entry point for loading configuration files.
Supports both static factory methods and a fluent builder API.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classFluent builder for constructing and loading configuration. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ConfigurationLoader.BuilderStarts building a configuration loader for the specified file path.static <T extends ConfigurablePojo<T>>
TLoads configuration from the specified file path with comments enabled.static <T extends ConfigurablePojo<T>>
TLoads configuration from the specified file path.
-
Constructor Details
-
ConfigurationLoader
public ConfigurationLoader()
-
-
Method Details
-
load
public static <T extends ConfigurablePojo<T>> T load(Path filePath, Supplier<T> defaultPojoSupplier) Loads configuration from the specified file path with comments enabled. -
load
public static <T extends ConfigurablePojo<T>> T load(Path filePath, Supplier<T> defaultPojoSupplier, boolean useComplexSaveWithComments) Loads configuration from the specified file path. -
from
Starts building a configuration loader for the specified file path. The format is automatically detected based on the file extension.Example usage:
AppConfig config = ConfigurationLoader.from(Paths.get("config.yaml")) .withComments() .load(AppConfig::new);- Parameters:
filePath- Path to the configuration file- Returns:
- A builder for further configuration
-