generateEnumClassBody method
Generate data class from CustomType.
{@category generator}
Implementation
String generateEnumClassBody(SquintGeneratorOptions options) {
if (values.length != valuesJSON.length) {
throw SquintException(
"Failed to generate enum class because values and valuesJSON are not of equal size.",
);
}
var hasJsonValues = false;
var index = 0;
while (index < values.length) {
if (values[index] != valuesJSON[index]) {
hasJsonValues = true;
}
index += 1;
}
return hasJsonValues
? _enumWithAnnotations(options)
: _enumWithoutAnnotations(options);
}