toJsonNodeGetters method
- String key
Generate getters.
{@category generator}
Implementation
List<String> toJsonNodeGetters(String key) {
final output = <String>[];
var index = 0;
while (index < values.length) {
output.add("""
case "${valuesJSON[index]}":
return $className.${values[index]};
""");
index += 1;
}
output.add("""
default:
throw SquintException("Unable to map value to $className enum: \${value.data}");
""");
return output;
}