org.bidib.wizard.model.status.BacklightPortStatus Maven / Gradle / Ivy
package org.bidib.wizard.model.status;
import org.bidib.jbidibc.messages.enums.BacklightPortEnum;
public enum BacklightPortStatus implements BidibStatus {
// @formatter:off
START(BacklightPortEnum.START, "start");
// @formatter:on
private final BacklightPortEnum type;
private final String key;
BacklightPortStatus(BacklightPortEnum type, String key) {
this.type = type;
this.key = key;
}
@Override
public BacklightPortEnum getType() {
return type;
}
@Override
public String getKey() {
return key;
}
public static BacklightPortStatus valueOf(BacklightPortEnum type) {
BacklightPortStatus result = null;
for (BacklightPortStatus e : values()) {
if (e.type == type) {
result = e;
break;
}
}
if (result == null) {
throw new IllegalArgumentException("cannot map " + type + " to a backlight port status");
}
return result;
}
@Override
public BacklightPortStatus[] getValues() {
return new BacklightPortStatus[] { START };
}
}