/*******************************************************************************
 * (C) Copyright 2016 Hewlett Packard Enterprise Development LP
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * You may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *******************************************************************************/
package com.hp.ov.sdk.dto.networking.logicalinterconnectgroup;

import java.util.HashMap;
import java.util.Map;

public enum ConfigType {

    CustomNoFCoE("CustomNoFCoE"),
    CustomWithFCoE("CustomWithFCoE"),
    NA("NA"),
    Passthrough("Passthrough"),
    Unknown("Unknown");

    private final String value;
    private final static Map<String, ConfigType> CONSTANTS = new HashMap<String, ConfigType>();

    static {
        for (ConfigType c: values()) {
            CONSTANTS.put(c.value, c);
        }
    }

    private ConfigType(String value) {
        this.value = value;
    }

    @Override
    public String toString() {
        return this.value;
    }

    public static ConfigType fromValue(String value) {
        ConfigType constant = CONSTANTS.get(value);
        if (constant == null) {
            throw new IllegalArgumentException(value);
        } else {
            return constant;
        }
    }

}
