We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9a4a101 commit a4ce2ffCopy full SHA for a4ce2ff
1 file changed
core/src/main/kotlin/org/evomaster/core/search/gene/collection/EnumGene.kt
@@ -203,6 +203,15 @@ class EnumGene<T : Comparable<T>>(
203
return valueNames?.get(index)
204
}
205
206
+ /**
207
+ * [EnumGene] can be used in DTOs when the API spec contains either example values or an enum.
208
+ * Since the [EnumGene] uses generics to hold values, this function returns the type to be used
209
+ * by the DTO writing mechanism.
210
+ *
211
+ * @param isKotlinOutput to format output as Int instead of Integer when values are int numbers
212
213
+ * @return the String class name of the type being represented in the [EnumGene]. Default is String.
214
+ */
215
fun getValueType(isKotlinOutput: Boolean): String {
216
return when {
217
values.isEmpty() -> "String"
0 commit comments