diff --git a/dinky-common/src/main/java/org/dinky/data/enums/GatewayType.java b/dinky-common/src/main/java/org/dinky/data/enums/GatewayType.java index 7ca2ee4e1d..5f46912a08 100644 --- a/dinky-common/src/main/java/org/dinky/data/enums/GatewayType.java +++ b/dinky-common/src/main/java/org/dinky/data/enums/GatewayType.java @@ -21,11 +21,14 @@ import org.dinky.assertion.Asserts; +import lombok.Getter; + /** * SubmitType * * @since 2021/10/29 */ +@Getter public enum GatewayType { LOCAL("l", "local"), STANDALONE("s", "standalone"), @@ -44,30 +47,17 @@ public enum GatewayType { this.longValue = longValue; } - public String getValue() { - return value; - } - - public String getLongValue() { - return longValue; - } - public static GatewayType get(String value) { for (GatewayType type : GatewayType.values()) { - if (Asserts.isEquals(type.getValue(), value) || Asserts.isEquals(type.getLongValue(), value)) { + if (Asserts.isEquals(type.getValue(), value) + || Asserts.isEquals(type.getLongValue(), value) + || Asserts.isEquals(type.toString(), value)) { return type; } } return GatewayType.LOCAL; } - public static GatewayType getSessionType(String value) { - if (value.contains("kubernetes")) { - return GatewayType.KUBERNETES_SESSION; - } - return GatewayType.YARN_SESSION; - } - public GatewayType getSessionType() { if (longValue.contains("kubernetes")) { return GatewayType.KUBERNETES_SESSION;