Skip to content

Commit

Permalink
add parameters to enum constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
kkatelia committed Mar 20, 2024
1 parent 3bae6d6 commit 0ccf925
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ abstract class BaseDataTypeGenerator(
val enumBuilder = TypeSpec
.enumBuilder("Field")
.addModifiers(Modifier.PUBLIC)
.addField(FieldSpec.builder(com.squareup.javapoet.TypeName.INT, "ordinal").initializer("-1").build())
.addField(FieldSpec.builder(ClassName.INT, "ordinal").initializer("-1").build())
.addMethod(MethodSpec
.methodBuilder("getOrdinal")
.addModifiers(Modifier.PUBLIC)
Expand All @@ -396,6 +396,7 @@ abstract class BaseDataTypeGenerator(
)
.addMethod(MethodSpec
.constructorBuilder()
.addParameter(ClassName.INT, "ordinal")
.addCode(
"""
|this.ordinal = ordinal;
Expand Down

0 comments on commit 0ccf925

Please sign in to comment.