package net.avalara.avatax.rest.client.enums;

/*
 * AvaTax Software Development Kit for Java JRE based environments
 *
 * (c) 2004-2018 Avalara, Inc.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * @@author     Dustin Welden <dustin.welden@@avalara.com>
 * @@copyright  2004-2018 Avalara, Inc.
 * @@license    https://www.apache.org/licenses/LICENSE-2.0
 * @@link       https://github.com/avadev/AvaTax-REST-V2-JRE-SDK
 */

/**
 * @PhpComment(EnumModel.Summary, 1)
 */
public enum @EnumModel.Name {
@foreach(var v in EnumModel.Values) {
WriteLine("    /** ");
WriteLine("     * " + PhpComment(v.Summary, 5));
WriteLine("     */");
WriteLine("    {0} = {1},", v.Name, v.Value);
WriteLine("");
}
}
    
@@ -38,16 +38,42 @@
 t.enums;
+%0Aimport java.util.HashMap;
 %0A%0A/*%0A * 
@@ -615,21 +615,59 @@
 @for
-each(
+(int i = 0; i%3CEnumModel.Values.Count; i++)%7B%0A
 var v 
-in
+=
  Enu
@@ -683,11 +683,12 @@
 lues
-) %7B
+%5Bi%5D;
 %0AWri
@@ -800,15 +800,16 @@
  %7B0%7D
- = %7B1%7D,
+(%7B1%7D)%7B2%7D
 %22, v
@@ -826,30 +826,507 @@
 alue
-);%0AWriteLine(%22%22);%0A%7D%0A%7D%0A    
+, ((i %3C EnumModel.Values.Count - 1) ? %22,%22 : %22;%22));%0AWriteLine(%22%22);%0A%7D%0A    private int value;%0A%09private static HashMap map = new HashMap%3C%3E();%0A%09%0A%09private @EnumModel.Name@Emit(%22(int value)%22) %7B%0A%09%09this.value = value;%0A%09%7D%0A%09%0A%09static %7B%0A%09%09for (@EnumModel.Name enumName : @EnumModel.Name@Emit(%22.values())%22) %7B%0A%09%09%09map.put(enumName.value, enumName);%0A%09%09%7D%0A%09%7D%0A%09%0A%09public static @EnumModel.Name @Emit(%22valueOf(int intValue)%22) %7B%0A%09%09return (@EnumModel.Name) map.get(intValue);%0A%09%7D%0A%09%0A%09public int getValue() %7B%0A%09%09return value;%0A%09%7D%0A%7D%0A

Include enum integer value logic in java SDK template.