diff --git a/pom.xml b/pom.xml
index dec1722..0b25067 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
dev.spexxConfigurationAPI
- 1.0.6
+ 1.1jarConfigurationAPI
diff --git a/src/main/java/dev/spexx/configurationAPI/config/YamlConfig.java b/src/main/java/dev/spexx/configurationAPI/config/YamlConfig.java
index 50c72a0..1987621 100644
--- a/src/main/java/dev/spexx/configurationAPI/config/YamlConfig.java
+++ b/src/main/java/dev/spexx/configurationAPI/config/YamlConfig.java
@@ -4,6 +4,8 @@
import org.jetbrains.annotations.NotNull;
import java.io.File;
+import java.util.List;
+import java.util.Optional;
/**
* Immutable snapshot of a YAML configuration file.
@@ -28,73 +30,132 @@
* cache instances long-term if they require access to the most up-to-date
* configuration state.
*
- * @apiNote
- * To obtain the latest configuration, retrieve a new instance from the managing
- * component instead of reusing previously obtained references.
- *
- * @implSpec
- * Thread-safety is achieved through immutability and atomic replacement of
- * instances at a higher level (for example, by the configuration manager).
- *
- * @implNote
- * The underlying {@link FileConfiguration} instance is assumed to be used in a
- * read-only manner. Modifying it directly may lead to inconsistent behavior.
- *
- * @since 1.0.0
+ * @since 1.1.0
*/
-public final class YamlConfig {
+public record YamlConfig(@NotNull File file, @NotNull FileConfiguration config) {
/**
- * The underlying configuration file on disk.
+ * Returns the underlying configuration file.
*/
- private final @NotNull File file;
+ @Override
+ public @NotNull File file() {
+ return file;
+ }
/**
- * Parsed configuration snapshot.
+ * Returns the parsed configuration snapshot.
+ *
+ *
The returned {@link FileConfiguration} represents a stable, immutable
- * view of the configuration at the time this {@code YamlConfig} instance
- * was created.
- *
- *
This object should be treated as read-only.
+ * Returns a boolean value at the given path.
+ */
+ public @NotNull Optional getBoolean(@NotNull String path) {
+ return config.contains(path)
+ ? Optional.of(config.getBoolean(path))
+ : Optional.empty();
+ }
+
+ /**
+ * Returns a double value at the given path.
+ */
+ public @NotNull Optional getDouble(@NotNull String path) {
+ return config.contains(path)
+ ? Optional.of(config.getDouble(path))
+ : Optional.empty();
+ }
+
+ /**
+ * Returns a float value at the given path.
+ */
+ public @NotNull Optional getFloat(@NotNull String path) {
+ return config.contains(path)
+ ? Optional.of((float) config.getDouble(path))
+ : Optional.empty();
+ }
+
+ /**
+ * Returns a string list at the given path.
+ */
+ public @NotNull Optional> getStringList(@NotNull String path) {
+ return config.contains(path)
+ ? Optional.of(config.getStringList(path))
+ : Optional.empty();
+ }
+
+ /**
+ * Returns a raw object at the given path.
+ */
+ public @NotNull Optional