diff --git a/common/src/main/java/org/dromara/dynamictp/common/em/ConfigFileTypeEnum.java b/common/src/main/java/org/dromara/dynamictp/common/em/ConfigFileTypeEnum.java index 68db27b25..456cdeeda 100644 --- a/common/src/main/java/org/dromara/dynamictp/common/em/ConfigFileTypeEnum.java +++ b/common/src/main/java/org/dromara/dynamictp/common/em/ConfigFileTypeEnum.java @@ -17,6 +17,7 @@ package org.dromara.dynamictp.common.em; +import lombok.AllArgsConstructor; import lombok.Getter; /** @@ -26,6 +27,7 @@ * @since 1.0.0 **/ @Getter +@AllArgsConstructor public enum ConfigFileTypeEnum { /** @@ -40,10 +42,6 @@ public enum ConfigFileTypeEnum { private final String value; - ConfigFileTypeEnum(String value) { - this.value = value; - } - public static ConfigFileTypeEnum of(String value) { for (ConfigFileTypeEnum typeEnum : ConfigFileTypeEnum.values()) { if (typeEnum.value.equals(value)) { diff --git a/common/src/main/java/org/dromara/dynamictp/common/em/NotifyItemEnum.java b/common/src/main/java/org/dromara/dynamictp/common/em/NotifyItemEnum.java index 1f7668f89..10329bd15 100644 --- a/common/src/main/java/org/dromara/dynamictp/common/em/NotifyItemEnum.java +++ b/common/src/main/java/org/dromara/dynamictp/common/em/NotifyItemEnum.java @@ -17,6 +17,7 @@ package org.dromara.dynamictp.common.em; +import lombok.AllArgsConstructor; import lombok.Getter; /** @@ -26,6 +27,7 @@ * @since 1.0.0 **/ @Getter +@AllArgsConstructor public enum NotifyItemEnum { /** @@ -63,11 +65,6 @@ public enum NotifyItemEnum { private final String unit; - NotifyItemEnum(String value, String unit) { - this.value = value; - this.unit = unit; - } - public static NotifyItemEnum of(String value) { for (NotifyItemEnum notifyItem : NotifyItemEnum.values()) { if (notifyItem.value.equals(value)) { diff --git a/common/src/main/java/org/dromara/dynamictp/common/em/QueueTypeEnum.java b/common/src/main/java/org/dromara/dynamictp/common/em/QueueTypeEnum.java index e33346a3c..6b9427fed 100644 --- a/common/src/main/java/org/dromara/dynamictp/common/em/QueueTypeEnum.java +++ b/common/src/main/java/org/dromara/dynamictp/common/em/QueueTypeEnum.java @@ -17,6 +17,7 @@ package org.dromara.dynamictp.common.em; +import lombok.AllArgsConstructor; import org.dromara.dynamictp.common.ex.DtpException; import org.dromara.dynamictp.common.queue.MemorySafeLinkedBlockingQueue; import org.dromara.dynamictp.common.queue.VariableLinkedBlockingQueue; @@ -43,6 +44,7 @@ **/ @Slf4j @Getter +@AllArgsConstructor public enum QueueTypeEnum { /** @@ -66,13 +68,9 @@ public enum QueueTypeEnum { MEMORY_SAFE_LINKED_BLOCKING_QUEUE(9, "MemorySafeLinkedBlockingQueue"); - private final Integer code; - private final String name; + private final int code; - QueueTypeEnum(Integer code, String name) { - this.code = code; - this.name = name; - } + private final String name; public static BlockingQueue buildLbq(String name, int capacity) { return buildLbq(name, capacity, false, 256); diff --git a/common/src/main/java/org/dromara/dynamictp/common/em/RejectedTypeEnum.java b/common/src/main/java/org/dromara/dynamictp/common/em/RejectedTypeEnum.java index 6bb807a02..3d28d1b80 100644 --- a/common/src/main/java/org/dromara/dynamictp/common/em/RejectedTypeEnum.java +++ b/common/src/main/java/org/dromara/dynamictp/common/em/RejectedTypeEnum.java @@ -17,6 +17,7 @@ package org.dromara.dynamictp.common.em; +import lombok.AllArgsConstructor; import lombok.Getter; import lombok.extern.slf4j.Slf4j; @@ -28,6 +29,7 @@ **/ @Slf4j @Getter +@AllArgsConstructor public enum RejectedTypeEnum { /** @@ -43,7 +45,4 @@ public enum RejectedTypeEnum { private final String name; - RejectedTypeEnum(String name) { - this.name = name; - } } diff --git a/core/src/main/java/org/dromara/dynamictp/core/aware/AwareTypeEnum.java b/core/src/main/java/org/dromara/dynamictp/core/aware/AwareTypeEnum.java index af0514d6f..c6ec7d87e 100644 --- a/core/src/main/java/org/dromara/dynamictp/core/aware/AwareTypeEnum.java +++ b/core/src/main/java/org/dromara/dynamictp/core/aware/AwareTypeEnum.java @@ -17,12 +17,17 @@ package org.dromara.dynamictp.core.aware; +import lombok.AllArgsConstructor; +import lombok.Getter; + /** * AwareType Enum * * @author kyao * @since 1.1.4 */ +@Getter +@AllArgsConstructor public enum AwareTypeEnum { /** @@ -44,16 +49,4 @@ public enum AwareTypeEnum { private final String name; - AwareTypeEnum(int order, String name) { - this.order = order; - this.name = name; - } - - public int getOrder() { - return order; - } - - public String getName() { - return name; - } } diff --git a/core/src/main/java/org/dromara/dynamictp/core/executor/ExecutorType.java b/core/src/main/java/org/dromara/dynamictp/core/executor/ExecutorType.java index 4f60669a9..309866bda 100644 --- a/core/src/main/java/org/dromara/dynamictp/core/executor/ExecutorType.java +++ b/core/src/main/java/org/dromara/dynamictp/core/executor/ExecutorType.java @@ -17,6 +17,7 @@ package org.dromara.dynamictp.core.executor; +import lombok.AllArgsConstructor; import org.dromara.dynamictp.core.executor.eager.EagerDtpExecutor; import lombok.Getter; import org.dromara.dynamictp.core.executor.priority.PriorityDtpExecutor; @@ -28,6 +29,7 @@ * @since 1.0.4 **/ @Getter +@AllArgsConstructor public enum ExecutorType { /** @@ -59,11 +61,6 @@ public enum ExecutorType { private final Class clazz; - ExecutorType(String name, Class clazz) { - this.name = name; - this.clazz = clazz; - } - public static Class getClass(String name) { for (ExecutorType type : ExecutorType.values()) { if (type.name.equals(name)) { diff --git a/extension/extension-limiter-redis/src/main/java/org/dromara/dynamictp/extension/limiter/redis/em/RateLimitEnum.java b/extension/extension-limiter-redis/src/main/java/org/dromara/dynamictp/extension/limiter/redis/em/RateLimitEnum.java index 6b122149a..25be3f157 100644 --- a/extension/extension-limiter-redis/src/main/java/org/dromara/dynamictp/extension/limiter/redis/em/RateLimitEnum.java +++ b/extension/extension-limiter-redis/src/main/java/org/dromara/dynamictp/extension/limiter/redis/em/RateLimitEnum.java @@ -17,6 +17,7 @@ package org.dromara.dynamictp.extension.limiter.redis.em; +import lombok.AllArgsConstructor; import lombok.Getter; /** @@ -26,6 +27,7 @@ * @since 1.0.8 **/ @Getter +@AllArgsConstructor public enum RateLimitEnum { /** @@ -37,16 +39,4 @@ public enum RateLimitEnum { private final String scriptName; - RateLimitEnum(final String keyName, final String scriptName) { - this.keyName = keyName; - this.scriptName = scriptName; - } - - public String getKeyName() { - return this.keyName; - } - - public String getScriptName() { - return this.scriptName; - } } diff --git a/starter/starter-adapter/starter-adapter-webserver/src/main/java/org/dromara/dynamictp/starter/adapter/webserver/undertow/UndertowTaskPoolEnum.java b/starter/starter-adapter/starter-adapter-webserver/src/main/java/org/dromara/dynamictp/starter/adapter/webserver/undertow/UndertowTaskPoolEnum.java index ce6fe1a61..0ed5e40d6 100644 --- a/starter/starter-adapter/starter-adapter-webserver/src/main/java/org/dromara/dynamictp/starter/adapter/webserver/undertow/UndertowTaskPoolEnum.java +++ b/starter/starter-adapter/starter-adapter-webserver/src/main/java/org/dromara/dynamictp/starter/adapter/webserver/undertow/UndertowTaskPoolEnum.java @@ -17,6 +17,7 @@ package org.dromara.dynamictp.starter.adapter.webserver.undertow; +import lombok.AllArgsConstructor; import lombok.Getter; /** @@ -26,6 +27,7 @@ * @since 1.1.3 */ @Getter +@AllArgsConstructor public enum UndertowTaskPoolEnum { /** @@ -46,14 +48,10 @@ public enum UndertowTaskPoolEnum { /** * ExecutorServiceTaskPool */ - EXECUTOR_SERVICE_TASK_POOL("ExecutorServiceTaskPool", "delegate"),; + EXECUTOR_SERVICE_TASK_POOL("ExecutorServiceTaskPool", "delegate"); private final String className; private final String internalExecutor; - UndertowTaskPoolEnum(String className, String internalExecutor) { - this.className = className; - this.internalExecutor = internalExecutor; - } }