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

org.openl.codegen.template.rules-enum.vm Maven / Gradle / Ivy

There is a newer version: 5.19.9
Show newest version
package $enumPackage;

public enum $enumName {

#foreach( $valueDefinition in $values )
	${valueDefinition.Name}("$valueDefinition.DisplayName")#if( $velocityHasNext ),#else;#end

#end

	private final String displayName;

	private $enumName (String displayName) {
		this.displayName = displayName;
	}

	@Override
	public String toString() {
		return displayName;
	}
	
	public static $enumName fromString(String displayName) {
		for ($enumName v : ${enumName}.values()) {
			if (displayName.equalsIgnoreCase(v.displayName)) {
				return v;
			}
		}
		
		throw new IllegalArgumentException("No constant with displayName " + displayName + " found");
  	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy