Skip to content

Index

hexagon_core / com.hexagonkt.helpers

Package com.hexagonkt.helpers

JVM information, a logger class and other useful utilities.

Types

Name Summary
Ansi object Ansi
Jvm Object with utilities to gather information about the running JVM.object Jvm
StringsSamplesTest class StringsSamplesTest

Exceptions

Name Summary
CodedException Exception with a numeric code.class CodedException :RuntimeException
MultipleException Exception with a list of causes. Cause is null as it can't be tell which one of the list is the cause.class MultipleException :RuntimeException

Extensions for External Classes

Name Summary
java.time.LocalDate
java.time.LocalDateTime
java.time.LocalTime
java.time.ZonedDateTime
java.util.Date
java.util.UUID
kotlin.collections.Collection
kotlin.collections.List
kotlin.collections.Map
kotlin.Int
kotlin.Long
kotlin.String
kotlin.text.Regex
kotlin.Throwable

Properties

Name Summary
eol Runtime specific end of line.val eol:String
fail Syntax sugar to throw errors.val fail:Nothing
logger Default logger for when you feel too lazy to declare one.val logger:Logger

Functions

Name Summary
check TODO.fun check(message:String= "Multiple exceptions", vararg blocks: () ->Unit):Unit
freePort Return a random free port (not used by any other local process).fun freePort():Int
isPortOpened Check if a port is already opened.fun isPortOpened(port:Int):Boolean
notEmpty TODO.fun <V> notEmpty(value: V?):Boolean
println TODO.fun <T> T.println(prefix:String= ""): T
retry Execute a lambda until no exception is thrown or a number of times is reached.fun <T> retry(times:Int, delay:Long, block: () -> T): T
trace TODO.fun <T> T.trace(prefix:String= ""): T
utf8 fun utf8(vararg bytes:Int):String
uuid TODO.fun uuid(text:String):UUID
fun uuid(bytes:ByteArray):UUID

Comments