All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bidib.wizard.mvc.stepcontrol.model.MicroStepsEnum Maven / Gradle / Ivy

There is a newer version: 2.0.29
Show newest version
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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy