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

com.rosetta.externalsynonym.model.ZEnum5 Maven / Gradle / Ivy

There is a newer version: 11.25.1
Show newest version
package com.rosetta.externalsynonym.model;

import com.rosetta.model.lib.annotations.RosettaEnum;
import com.rosetta.model.lib.annotations.RosettaEnumValue;
import com.rosetta.model.lib.annotations.RosettaSynonym;
import java.util.Collections;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;


/**
 * @version test
 */
@RosettaEnum("ZEnum5")
public enum ZEnum5 {

	@RosettaSynonym(value = "AA", source = "Bank_A")
	@RosettaEnumValue(value = "ZELDA") ZELDA("ZELDA"),
	
	@RosettaSynonym(value = "BB", source = "Bank_A")
	@RosettaEnumValue(value = "WARRIOR") WARRIOR("WARRIOR")
;
	private static Map values;
	static {
        Map map = new ConcurrentHashMap<>();
		for (ZEnum5 instance : ZEnum5.values()) {
			map.put(instance.toDisplayString(), instance);
		}
		values = Collections.unmodifiableMap(map);
    }

	private final String rosettaName;
	private final String displayName;

	ZEnum5(String rosettaName) {
		this(rosettaName, null);
	}

	ZEnum5(String rosettaName, String displayName) {
		this.rosettaName = rosettaName;
		this.displayName = displayName;
	}

	public static ZEnum5 fromDisplayName(String name) {
		ZEnum5 value = values.get(name);
		if (value == null) {
			throw new IllegalArgumentException("No enum constant with display name \"" + name + "\".");
		}
		return value;
	}

	@Override
	public String toString() {
		return toDisplayString();
	}

	public String toDisplayString() {
		return displayName != null ?  displayName : rosettaName;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy