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

com.ch.status.ExecutionStatus Maven / Gradle / Ivy

There is a newer version: 1.0.9
Show newest version
package com.ch.status;

import java.util.Collections;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public enum ExecutionStatus {

	COMPLETED("completed"), STARTED("started");

	private final String name;
	
	private static final Map ENUM_MAP;

	private ExecutionStatus(String name) {
		this.name = name;
	}
	public String toLower() {
		return name.toLowerCase();
	}

	@Override
	public String toString() {
		return name;
	}
	
	static {
        Map map = new ConcurrentHashMap();
        for (ExecutionStatus instance : ExecutionStatus.values()) {
            map.put(instance.toLower(),instance);
        }
        ENUM_MAP = Collections.unmodifiableMap(map);
    }

    public static ExecutionStatus get (String name) {
        return ENUM_MAP.get(name);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy