Coral
Coral is a common set of kotlin stdlib and platform stdlib extensions used in many of our Kotlin projects at Tenkiv.
Common | |
JVM |
Current features:
unimut()
delegate that initialises a variable to null then allows to be set exactly once at any time. Has optional Thread synchronisation built in, as well as optionalonSet()
andonGet()
functions to be executed accordingly. It throws a specific exception if you attempt to set it more than once which means you don't need to check for null when using a variable set with this delegate, works similarly to lateinit var.feq()
operator for generalised floating point equality.- Long extension properties for converting kotlin Longs into Durations.
can()
operator for checking if a class is equal to or inherits from another class (like the is operator but for classes instead of instances of classes, in Java this is theisAssignableFrom()
method).ValueInstant
typed tuple for pairing any value with a moment in time.average()
andfindRatio()
extension functions for collections.