org.bidib.wizard.model.status.InputStatus Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bidibwizard-model Show documentation
Show all versions of bidibwizard-model Show documentation
jBiDiB BiDiB Wizard Model POM
package org.bidib.wizard.model.status;
import org.bidib.jbidibc.messages.enums.InputEnum;
public enum InputStatus implements BidibStatus {
// @formatter:off
QUERY0(InputEnum.QUERY0, "query0"), QUERY1(InputEnum.QUERY1, "query1");
// @formatter:on
private final InputEnum type;
private final String key;
InputStatus(InputEnum type, String key) {
this.type = type;
this.key = key;
}
@Override
public InputEnum getType() {
return type;
}
@Override
public String getKey() {
return key;
}
public static InputStatus valueOf(InputEnum type) {
InputStatus result = null;
for (InputStatus e : values()) {
if (e.type == type) {
result = e;
break;
}
}
if (result == null) {
throw new IllegalArgumentException("cannot map " + type + " to a input status");
}
return result;
}
@Override
public InputStatus[] getValues() {
return new InputStatus[] { QUERY0, QUERY1 };
}
}