

package org.openkilda.rulemanager;

import static java.lang.String.format;

public enum OfVersion {

    OF_12,
    OF_13,
    OF_14,
    OF_15;

    /**
     * Converts String value to enum value.
     */
    public static OfVersion of(String version) {
        switch (version) {
            case "OF_12":
                return OF_12;
            case "OF_13":
                return OF_13;
            case "OF_14":
                return OF_14;
            case "OF_15":
                return OF_15;
            default:
                throw new IllegalStateException(format("Can't parse OpenFlow Version %s", version));
        }
    }
}
