io.protostuff.generator.java.enum.stg Maven / Gradle / Ivy
delimiters "<", ">"
import "io/protostuff/generator/core.stg"
import "io/protostuff/generator/java/generator.stg"
enum(enum) ::= <<
package ;
>>
enum_body(enum) ::= <<
public enum implements io.protostuff.EnumLite\<\>{
,
UNRECOGNIZED(-1);
private final int value;
private (int n) {
this.value = n;
}
@Override
public int getNumber() {
if (value == -1) {
throw new java.lang.IllegalStateException(
"Can't get the number of an unknown enum value.");
}
return value;
}
public static final valueOf(int tag) {
switch(tag) {
: return ;}; separator="\n">
default: return UNRECOGNIZED;
}
}
}
>>
enum_constant(constant) ::= <<
()
>>
enum_default_value(enum) ::= <%
%>
© 2015 - 2024 Weber Informatics LLC | Privacy Policy