diff --git a/core/src/main/java/cc/carm/lib/configuration/adapter/ValueType.java b/core/src/main/java/cc/carm/lib/configuration/adapter/ValueType.java
index 6a97c38..1b8616f 100644
--- a/core/src/main/java/cc/carm/lib/configuration/adapter/ValueType.java
+++ b/core/src/main/java/cc/carm/lib/configuration/adapter/ValueType.java
@@ -1,14 +1,22 @@
package cc.carm.lib.configuration.adapter;
+import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.List;
+import java.util.Map;
import java.util.Objects;
/**
- * Used to get the generic type.
+ * {@link ValueType} used to get the generic type of the value,
+ * It can be used to check if an object is an instance of a specific type,
+ * and to cast objects to the correct type.
+ *
+ * Java's type system is not capable of retaining generic type information at runtime.
+ * This class is used to represent a type with its generic parameters.
+ *
*/
public abstract class ValueType {
@@ -43,7 +51,7 @@ public abstract class ValueType {
@SuppressWarnings("unchecked")
public static ValueType of(final Type type) {
if (type == null) throw new NullPointerException("Type cannot be null");
- if (type instanceof Class>) { // Try handle primitive types
+ if (type instanceof Class>) { // Try to fast handle primitive types
Class> clazz = (Class>) type;
for (ValueType> valueType : PRIMITIVE_TYPES) {
if (valueType.getRawType() == clazz) {
@@ -63,6 +71,18 @@ public abstract class ValueType {
return of(List.class, paramType);
}
+ public static ValueType> ofList(final @NotNull ValueType paramType) {
+ return of(List.class, paramType.getType());
+ }
+
+ public static ValueType