I have a list of objects that looks like that:
class Attachment(
val attachmentId: Int,
val attachmentName: String?,
val size: Long
)
I wanna have a hash map that uses the attachmentName as the key and the whole class as the value.
The issue is that the attachmentName can be null, I wanna ignore these items (with null on attachmentName so that they wont appear on the hash map)
I wanna know if there's an elegant was to do it in Kotlin Thanks