bocloud.ims.provider/bocloud.manageone.provider/src/main/java/com/bocloud/cmp/utils/StatusConverter.java

37 lines
1.3 KiB
Java

package com.bocloud.cmp.utils;
import com.bocloud.cmp.entity.enums.BocloudStatus;
public class StatusConverter {
public static class Network {
public static String converter(String value) {
String status = null;
if ("ACTIVE".equalsIgnoreCase(value)) {
status = BocloudStatus.Network.RUNNING.name();
} else if ("DOWN".equalsIgnoreCase(value)) {
status = BocloudStatus.Network.STOPPED.name();
} else if ("BUILD".equalsIgnoreCase(value)) {
status = BocloudStatus.Network.BUILDING.name();
} else if ("ERROR".equalsIgnoreCase(value)) {
status = BocloudStatus.Network.ERROR.name();
} else if ("PENDING_CREATE".equalsIgnoreCase(value)) {
status = BocloudStatus.Network.PENDING_CREATE.name();
} else if ("PENDING_UPDATE".equalsIgnoreCase(value)) {
status = BocloudStatus.Network.PENDING_UPDATE.name();
} else if ("PENDING_DELETE".equalsIgnoreCase(value)) {
status = BocloudStatus.Network.PENDING_DELETE.name();
} else if ("UNRECOGNIZED".equalsIgnoreCase(value)) {
status = BocloudStatus.Network.EXCEPTION.name();
} else if ("CREATED".equalsIgnoreCase(value)) {
status = BocloudStatus.Network.CREATED.name();
} else if ("INACTIVE".equalsIgnoreCase(value)) {
status = BocloudStatus.Network.INACTIVE.name();
} else {
status = BocloudStatus.Network.EXCEPTION.name();
}
return status;
}
}
}