
org.xlcloud.service.ProjectStatus Maven / Gradle / Ivy
The newest version!
/*
* Copyright 2012 AMG.lab, a Bull Group Company
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.xlcloud.service;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlType;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonValue;
/**
* Class represents status of project Environment
*
* @author Michał Kamiński, AMG.net
* @author Konrad Król, AMG.net
*/
@XmlType( name = "ProjectStatus" )
@XmlEnum
public enum ProjectStatus {
@XmlEnumValue( "starting" )
STARTING("starting"),
@XmlEnumValue( "deleting" )
DELETING("deleting"),
@XmlEnumValue( "failed" )
FAILED("failed"),
@XmlEnumValue( "failed_to_delete" )
FAILED_TO_DELETE("failed_to_delete"),
@XmlEnumValue( "active" )
ACTIVE("active");
private final String value;
ProjectStatus( String v ) {
value = v;
}
@JsonValue
public String value() {
return value;
}
public static ProjectStatus fromValue(String v) {
for (ProjectStatus c : ProjectStatus.values()) {
if (c.value.equals(v)) {
return c;
}
}
throw new IllegalArgumentException(v);
}
@JsonIgnore
public boolean isCompleteStatus() {
return (this.equals(ACTIVE) || this.equals(FAILED) || this.equals(FAILED_TO_DELETE));
}
@JsonIgnore
public boolean isActive() {
return this.equals(ACTIVE);
}
@JsonIgnore
public boolean isUnaccessible(){
return (this.equals(FAILED) || this.equals(FAILED_TO_DELETE) || this.equals(DELETING));
}
public String toString() {
return value;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy