Skip to content

Commit a4ce2ff

Browse files
committed
Added Javadoc for EnumGene.getValueType
1 parent 9a4a101 commit a4ce2ff

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

  • core/src/main/kotlin/org/evomaster/core/search/gene/collection

core/src/main/kotlin/org/evomaster/core/search/gene/collection/EnumGene.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,15 @@ class EnumGene<T : Comparable<T>>(
203203
return valueNames?.get(index)
204204
}
205205

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+
*/
206215
fun getValueType(isKotlinOutput: Boolean): String {
207216
return when {
208217
values.isEmpty() -> "String"

0 commit comments

Comments
 (0)