github.com/suntong/easygen@v5.3.0+incompatible/test/enum_java.tmpl (about)

     1  {{- if .EnumComments -}}
     2  /**
     3    {{- range .EnumComments }}
     4   * {{.}}
     5    {{- end }}
     6   */
     7  {{- else -}}
     8  /** {{ cls2uc .EnumName }} is the representation of {{.EnumName}} */
     9  {{- end }}
    10  public enum {{cls2uc .EnumName}} {
    11  {{- range $i, $val := .Values -}}
    12    {{- if .Comment }}
    13    {{- if gt $i 0 }}
    14    {{ end }}
    15      // {{.Comment}}
    16    {{- end }}
    17      {{ .Name }}{{if eq (len $.Values|minus1) ($i)}};{{else}},{{end}}
    18  {{- end }}
    19  }