File: enum_java.tmpl

package info (click to toggle)
easygen 5.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 848 kB
  • sloc: sh: 14; makefile: 13
file content (19 lines) | stat: -rw-r--r-- 414 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{{- if .EnumComments -}}
/**
  {{- range .EnumComments }}
 * {{.}}
  {{- end }}
 */
{{- else -}}
/** {{ cls2uc .EnumName }} is the representation of {{.EnumName}} */
{{- end }}
public enum {{cls2uc .EnumName}} {
{{- range $i, $val := .Values -}}
  {{- if .Comment }}
  {{- if gt $i 0 }}
  {{ end }}
    // {{.Comment}}
  {{- end }}
    {{ .Name }}{{if eq (len $.Values|minus1) ($i)}};{{else}},{{end}}
{{- end }}
}