【代码优化】IoT:设备下行实现前,相关代码的整理
This commit is contained in:
@@ -33,17 +33,13 @@ public enum IotPluginDeployTypeEnum implements ArrayValuable<Integer> {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public static IotPluginDeployTypeEnum fromDeployType(Integer deployType) {
|
||||
public static IotPluginDeployTypeEnum valueOf(Integer deployType) {
|
||||
return Arrays.stream(values())
|
||||
.filter(value -> value.getDeployType().equals(deployType))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
}
|
||||
|
||||
public static boolean isValidDeployType(Integer deployType) {
|
||||
return fromDeployType(deployType) != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer[] array() {
|
||||
return ARRAYS;
|
||||
|
Reference in New Issue
Block a user