KotlinUtilsKt
Keywords: net.corda.core.utilities.KotlinUtilsKt class
Date: 2023-09-18

net.corda.core.utilities

## Class KotlinUtilsKt

- net.corda.core.utilities.KotlinUtilsKt

-     public class KotlinUtilsKt

- - ### Constructor Detail

    - #### KotlinUtilsKt

          public KotlinUtilsKt()

  - ### Method Detail

    - #### exactAdd

          public static int exactAdd(int $this$exactAdd,
                                     int b)

      Like the + operator but throws ArithmeticException in case of integer overflow.

      See Also:
        ArithmeticException

    - #### exactAdd

          public static long exactAdd(long $this$exactAdd,
                                      long b)

      Like the + operator but throws ArithmeticException in case of integer overflow.

      See Also:
        ArithmeticException

    - #### detailedLogger

          @NotNull
          public static org.slf4j.Logger detailedLogger()

      Returns the logger used for detailed logging.

    - #### contextLogger

          @NotNull
          public static org.slf4j.Logger contextLogger(@NotNull
                                                                java.lang.Object $this$contextLogger)

      When called from a companion object, returns the logger for the enclosing class.

    - #### trace

          public static void trace(@NotNull
                                   org.slf4j.Logger $this$trace,
                                   @NotNull
                                   kotlin.jvm.functions.Function0<java.lang.String> msg)

      Log a TRACE level message produced by evaluating the given lamdba, but only if TRACE logging is enabled.

    - #### debug

          public static void debug(@NotNull
                                   org.slf4j.Logger $this$debug,
                                   @NotNull
                                   kotlin.jvm.functions.Function0<java.lang.String> msg)

      Log a DEBUG level message produced by evaluating the given lamdba, but only if DEBUG logging is enabled.

    - #### getDays

          @NotNull
          public static java.time.Duration getDays(int $this$days)

      Extension method for easier construction of Durations in terms of integer days: `val twoDays = 2.days`.

      See Also:
        Duration, Duration.ofDays

    - #### getHours

          @NotNull
          public static java.time.Duration getHours(int $this$hours)

      Extension method for easier construction of Durations in terms of integer hours: `val twoHours = 2.hours`.

      See Also:
        Duration, Duration.ofHours

    - #### getMinutes

          @NotNull
          public static java.time.Duration getMinutes(int $this$minutes)

      Extension method for easier construction of Durations in terms of integer minutes: `val twoMinutes = 2.minutes`.

      See Also:
        Duration, Duration.ofMinutes

    - #### getSeconds

          @NotNull
          public static java.time.Duration getSeconds(int $this$seconds)

      Extension method for easier construction of Durations in terms of integer seconds: `val twoSeconds = 2.seconds`.

      See Also:
        Duration, Duration.ofSeconds

    - #### getMillis

          @NotNull
          public static java.time.Duration getMillis(int $this$millis)

      Extension method for easier construction of Durations in terms of integer milliseconds: `val twoMillis = 2.millis`.

      See Also:
        Duration, Duration.ofMillis

    - #### transient

          @NotNull
          public static <T> PropertyDelegate<T> transient(@NotNull
                                                                   kotlin.jvm.functions.Function0<? extends T> initializer)

      A simple wrapper that enables the use of Kotlin's `val x by transient { ... }` syntax. Such a property will not be serialized, and if it's missing (or the first time it's accessed), the initializer will be used to set it up.

    - #### toNonEmptySet

          @NotNull
          public static <T> NonEmptySet<T> toNonEmptySet(@NotNull
                                                                  java.util.Collection<? extends T> $this$toNonEmptySet)

      See Also:
        `NonEmptySet.copyOf`

    - #### getOrThrow

          public static <V> V getOrThrow(@NotNull
                                         java.util.concurrent.Future<V> $this$getOrThrow,
                                         @Nullable
                                         java.time.Duration timeout)

      Same as Future.get except that the ExecutionException is unwrapped.

      See Also:
        Future.get, ExecutionException