Is there a way to build a boxed `UInt` in Java, th...
# getting-started
r
Is there a way to build a boxed
UInt
in Java, that can be passed to Kotlin code expecting a
List<Uint>>
?
k
UInt
is implemented as an inline class and therefore the Kotlin function that takes
List<UInt>
gets mangled. You can work around this by specifying @JvmName.
r
I was using the ULong for validation - found a YouTrack from Roman Elizarov saying that was bad, m'kay, so I switched to just validating it. Shame, I much prefer type based validation. He doesn't explain why he's anti it.
h
Maybe because it is not very Java like? But shouldn’t https://github.com/Kotlin/KEEP/blob/jvm-expose-boxed/proposals/jvm-expose-boxed.md help you with a custom value class?
r
In my case it's actually Groovy rather than Java, and the only reason is that we're using Spock for testing, it's not a library expected to be consumed from Java.
r
Awesome, thanks!