org.openl.codegen.template.RuleService-rules-enum.vm Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of org.openl.rules.gen Show documentation
Show all versions of org.openl.rules.gen Show documentation
OpenL Code generation project
package $enumPackage;
/*
* #%L
* OpenL - RuleService - RuleService - Context
* %%
* Copyright (C) 2015 OpenL Tablets
* %%
* See the file LICENSE.txt for copying permission.
* #L%
*/
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