1
mirror of https://github.com/CarmJos/EasyConfiguration.git synced 2026-06-04 18:48:20 +08:00

docs: Add missing javadocs

This commit is contained in:
2025-02-16 02:14:15 +08:00
parent 0b16ae08db
commit 14a5f41649
4 changed files with 8 additions and 3 deletions
@@ -87,7 +87,7 @@ public class PathGenerator {
* Get the configuration name of the specified element. * Get the configuration name of the specified element.
* Use the naming convention of all lowercase and "-" links. * Use the naming convention of all lowercase and "-" links.
* <p> * <p>
* e.g. "SOME_NAME" -> "some-name" * e.g. "SOME_NAME" will be "some-name"
* *
* @param name source name * @param name source name
* @return the final path * @return the final path
@@ -104,7 +104,7 @@ public class PathGenerator {
// The content that is not named in all caps is then converted // The content that is not named in all caps is then converted
.replaceAll("([a-z])=([A-Z])", "$1_$2") .replaceAll("([a-z])=([A-Z])", "$1_$2")
// Remove any extra horizontal lines // Remove any extra horizontal lines
.replaceAll("=", "") .replace("=", "")
// Replace the underscore with a dash // Replace the underscore with a dash
.replace("_", "-") .replace("_", "-")
// Finally, convert it to all lowercase // Finally, convert it to all lowercase
@@ -108,6 +108,7 @@ public class ConfigurationMetaHolder {
* @param type {@link ConfigurationMetadata} * @param type {@link ConfigurationMetadata}
* @param value Value of meta * @param value Value of meta
* @param <V> Value type * @param <V> Value type
* @return Previous value of meta
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public <V> @Nullable V setIfPresent(@NotNull ConfigurationMetadata<V> type, @Nullable V value) { public <V> @Nullable V setIfPresent(@NotNull ConfigurationMetadata<V> type, @Nullable V value) {
@@ -13,7 +13,7 @@ public interface StandardOptions {
ConfigurationOption<Character> PATH_SEPARATOR = of('.'); ConfigurationOption<Character> PATH_SEPARATOR = of('.');
/** /**
* Whether to set & save default values if offered and not exists in configuration. * Whether to set and save default values if offered and not exists in configuration.
*/ */
ConfigurationOption<Boolean> SET_DEFAULTS = of(true); ConfigurationOption<Boolean> SET_DEFAULTS = of(true);
@@ -59,6 +59,8 @@ public abstract class CachedConfigValue<T> extends ConfigValue<T> {
} }
/** /**
* @param adapter Value adapter
* @param <O> Base object type
* @return Value's parser, parse base object to value. * @return Value's parser, parse base object to value.
*/ */
protected <O> @Nullable ValueParser<O> parserFor(@NotNull ValueAdapter<O> adapter) { protected <O> @Nullable ValueParser<O> parserFor(@NotNull ValueAdapter<O> adapter) {
@@ -69,6 +71,8 @@ public abstract class CachedConfigValue<T> extends ConfigValue<T> {
} }
/** /**
* @param adapter Value adapter
* @param <O> Base object type
* @return Value's serializer, parse value to base object. * @return Value's serializer, parse value to base object.
*/ */
protected <O> @Nullable ValueSerializer<O> serializerFor(@NotNull ValueAdapter<O> adapter) { protected <O> @Nullable ValueSerializer<O> serializerFor(@NotNull ValueAdapter<O> adapter) {