org.bidib.wizard.model.status.AccessoryOkayStatus Maven / Gradle / Ivy
package org.bidib.wizard.model.status;
import org.bidib.jbidibc.messages.enums.AccessoryOkayEnum;
public enum AccessoryOkayStatus implements BidibStatus {
// @formatter:off
NO_FEEDBACK(AccessoryOkayEnum.NO_FEEDBACK, "no_feedback"), QUERY0(AccessoryOkayEnum.QUERY0, "query0"), QUERY1(
AccessoryOkayEnum.QUERY1, "query1");
// @formatter:on
private final AccessoryOkayEnum type;
private final String key;
AccessoryOkayStatus(AccessoryOkayEnum type, String key) {
this.type = type;
this.key = key;
}
@Override
public AccessoryOkayEnum getType() {
return type;
}
@Override
public String getKey() {
return key;
}
public static AccessoryOkayStatus valueOf(AccessoryOkayEnum type) {
AccessoryOkayStatus result = null;
for (AccessoryOkayStatus e : values()) {
if (e.type == type) {
result = e;
break;
}
}
if (result == null) {
throw new IllegalArgumentException("cannot map " + type + " to a accessory okay status");
}
return result;
}
@Override
public AccessoryOkayStatus[] getValues() {
return new AccessoryOkayStatus[] { NO_FEEDBACK, QUERY0, QUERY1 };
}
}