alexhelder
06/26/2025, 1:23 AMvalue class DownloadManagerId(val value:Long) is there a way to “unwrap” this without having to say downloadManagerId.value at each use?Stephan Schröder
06/26/2025, 7:21 AMval downloadManagerIdValue = downloadManagerId.value or indirectly ``downloadManagerId.value.let { downloadManagerIdValue -> ... }``. But first you might question yourself if maybe you could rename your initial variable down to id since writing id.value seems way more palpable (you don't have to put the whole classname in each variable).
PS: don't forget the @JvmInline annotation (the only way value classes work currently) and rest assured that value will be an unwrapped Long at runtime (in case your unwrapping was meant to be an optimization instead of a name shortening).