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

com.spotinst.sdkjava.enums.VmLifeCycleEnumAzure Maven / Gradle / Ivy

There is a newer version: 1.0.121
Show newest version
package com.spotinst.sdkjava.enums;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public enum VmLifeCycleEnumAzure {

    SPOT("SPOT"),
    OD("ON_DEMAND");

    private static final Logger LOGGER = LoggerFactory.getLogger(VmLifeCycleEnumAzure.class);
    private String name;

    private VmLifeCycleEnumAzure(String name) {
        this.name = name;
    }

    public static VmLifeCycleEnumAzure fromName(String name) {
        VmLifeCycleEnumAzure retVal = null;

        for (VmLifeCycleEnumAzure vmLifecycleEnum : VmLifeCycleEnumAzure.values()) {
            if (name.equalsIgnoreCase(vmLifecycleEnum.name)) {
                retVal = vmLifecycleEnum;
                break;
            }
        }

        if (retVal == null) {
            LOGGER.error("Tried to create 'lifecycle' enum for: " + name + ", but we don't support such type ");
        }

        return retVal;
    }

    public String getName() {
        return name;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy