Yeah. I have that website favorited. In this case, the data model and everything is already created and I'm just trying to move this bug fix along. I did let them know that we could/should probably just keep everything as a single string.
r
Richard Gomez
03/16/2022, 1:32 PM
For this type of thing you could also just write the different formats explicitly in a conditional statement.
For example:
Copy code
data class Component(val type: String, val namespace: String? = null, val name: String, val version: String) {
val displayName: String by lazy { if (namespace != null) "$namespace:$name" else name }
}
e
ephemient
03/16/2022, 4:13 PM
as a convenience, if some parts may be null and you want to skip them,