org.bidib.wizard.model.status.AnalogPortStatus 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.AnalogPortEnum;
public enum AnalogPortStatus implements BidibStatus {
// @formatter:off
START(AnalogPortEnum.START, "start");
// @formatter:on
private final AnalogPortEnum type;
private final String key;
AnalogPortStatus(AnalogPortEnum type, String key) {
this.type = type;
this.key = key;
}
@Override
public AnalogPortEnum getType() {
return type;
}
@Override
public String getKey() {
return key;
}
public static AnalogPortStatus valueOf(AnalogPortEnum type) {
AnalogPortStatus result = null;
for (AnalogPortStatus e : values()) {
if (e.type == type) {
result = e;
break;
}
}
if (result == null) {
throw new IllegalArgumentException("cannot map " + type + " to a analog port status");
}
return result;
}
@Override
public AnalogPortStatus[] getValues() {
return new AnalogPortStatus[] { START };
}
}