org.bidib.wizard.mvc.stepcontrol.model.MicroStepsEnum Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bidibwizard-client Show documentation
Show all versions of bidibwizard-client Show documentation
jBiDiB BiDiB Wizard Client Application POM
package org.bidib.wizard.mvc.stepcontrol.model;
public enum MicroStepsEnum {
steps8("step8", 8), steps16("step16", 16), steps32("step32", 32), steps64("step64", 64), steps128("step128",
128), steps256("step256", 256);
private final String key;
private final Integer steps;
private MicroStepsEnum(String key, Integer steps) {
this.key = key;
this.steps = steps;
}
public String getKey() {
return key;
}
public Integer getSteps() {
return steps;
}
public static MicroStepsEnum fromValue(Integer value) {
MicroStepsEnum result = null;
for (MicroStepsEnum e : values()) {
if (e.steps.intValue() == value) {
result = e;
break;
}
}
if (result == null) {
throw new IllegalArgumentException("cannot map " + value + " to a MicroSteps enum");
}
return result;
}
@Override
public String toString() {
return key;
}
}