-
-
Save dilrajsingh1997/b42c2401c562021bbfe9bb1b0a47dcf2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
file addLine "data class $dataClassName (" | |
tabs++ | |
properties.forEach { property -> | |
val argumentName = property.simpleName.asString() | |
val resolvedType: KSType = property.type.resolve() | |
file addLine "val $argumentName: " | |
file addPhrase (resolvedType.declaration.qualifiedName?.asString() ?: run { | |
logger.error("Invalid property type", property) | |
return | |
}) | |
file addPhrase if (resolvedType.nullability == Nullability.NULLABLE) "?" else "" | |
file addPhrase ", " | |
} | |
tabs-- | |
file addLine ")" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment