
com.hpe.caf.services.job.api.generated.model.JobStatus Maven / Gradle / Ivy
The newest version!
package com.hpe.caf.services.job.api.generated.model;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
/**
* The status of the job.
*/
public enum JobStatus {
ACTIVE("Active"),
CANCELLED("Cancelled"),
COMPLETED("Completed"),
FAILED("Failed"),
PAUSED("Paused"),
WAITING("Waiting");
private String value;
JobStatus(String value) {
this.value = value;
}
/**
* Convert a String into String, as specified in the
* See JAX RS 2.0 Specification, section 3.2, p. 12
*/
public static JobStatus fromString(String s) {
for (JobStatus b : JobStatus.values()) {
// using Objects.toString() to be safe if value type non-object type
// because types like 'int' etc. will be auto-boxed
if (java.util.Objects.toString(b.value).equals(s)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected string value '" + s + "'");
}
@Override
@JsonValue
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static JobStatus fromValue(String value) {
for (JobStatus b : JobStatus.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy