docs: Add docs to new config classes

This commit is contained in:
Ben Woo 2023-06-28 20:18:26 +08:00
parent d1370bfb8c
commit 3b384dbe6d
No known key found for this signature in database
GPG Key ID: FB2A3645536E12C8
3 changed files with 16 additions and 2 deletions

View File

@ -8,6 +8,9 @@ import org.jetbrains.annotations.Nullable;
import java.util.logging.Logger;
/**
* Configuration handle for a single configuration section.
*/
public class ConfigurationSectionHandle extends GenericConfigHandle<ConfigurationSection> {
public static Builder<? extends Builder> builder(@NotNull ConfigurationSection configurationSection) {
return new Builder<>(configurationSection);
@ -21,6 +24,11 @@ public class ConfigurationSectionHandle extends GenericConfigHandle<Configuratio
this.config = configurationSection;
}
/**
* Builder for {@link ConfigurationSectionHandle}.
*
* @param <B> The builder type.
*/
public static class Builder<B extends Builder<B>> extends GenericConfigHandle.Builder<ConfigurationSection, B> {
private final ConfigurationSection configurationSection;
@ -28,6 +36,9 @@ public class ConfigurationSectionHandle extends GenericConfigHandle<Configuratio
this.configurationSection = configurationSection;
}
/**
* {@inheritDoc}
*/
@Override
public @NotNull ConfigurationSectionHandle build() {
return new ConfigurationSectionHandle(configurationSection, logger, nodes, migrator);

View File

@ -99,7 +99,7 @@ abstract class FileConfigHandle<C extends FileConfiguration> extends GenericConf
}
/**
* Builder for {@link FileConfigHandle}.
* Abstract builder for {@link FileConfigHandle}.
*
* @param <C> The configuration type.
* @param <B> The builder type.

View File

@ -12,6 +12,9 @@ import org.jetbrains.annotations.Nullable;
import java.util.logging.Logger;
/**
* Generic configuration handle for all ConfigurationSection types.
*/
public abstract class GenericConfigHandle<C extends ConfigurationSection> {
protected final @Nullable Logger logger;
protected final @Nullable NodeGroup nodes;
@ -121,7 +124,7 @@ public abstract class GenericConfigHandle<C extends ConfigurationSection> {
}
/**
* Builder for {@link FileConfigHandle}.
* Abstract builder for {@link GenericConfigHandle}.
*
* @param <C> The configuration type.
* @param <B> The builder type.