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

org.bidib.wizard.model.status.InputStatus Maven / Gradle / Ivy

There is a newer version: 2.0.26
Show newest version
package org.bidib.wizard.model.status;

import org.bidib.jbidibc.messages.enums.InputEnum;

public enum InputStatus implements BidibStatus {
    // @formatter:off
    QUERY0(InputEnum.QUERY0, "query0"), QUERY1(InputEnum.QUERY1, "query1");
    // @formatter:on

    private final InputEnum type;

    private final String key;

    InputStatus(InputEnum type, String key) {
        this.type = type;
        this.key = key;
    }

    @Override
    public InputEnum getType() {
        return type;
    }

    @Override
    public String getKey() {
        return key;
    }

    public static InputStatus valueOf(InputEnum type) {
        InputStatus result = null;

        for (InputStatus e : values()) {
            if (e.type == type) {
                result = e;
                break;
            }
        }
        if (result == null) {
            throw new IllegalArgumentException("cannot map " + type + " to a input status");
        }
        return result;
    }

    @Override
    public InputStatus[] getValues() {
        return new InputStatus[] { QUERY0, QUERY1 };
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy