Package

org.tupol

utils

Permalink

package utils

A few common functions that might be useful.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. utils
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. implicit class MapOps[K, V] extends AnyRef

    Permalink

    Decorate Scala Maps with various utility functions

  2. implicit final class SeqTryOps[T] extends AnyVal

    Permalink

    Simple decorator for the scala Try, which adds the following simple functions:

  3. implicit final class TryOps[T] extends AnyVal

    Permalink

    Simple decorator for the scala Try, which adds the following simple functions: - composable error logging - composable success logging

Value Members

  1. def allOkOrFail[T](seqOfTry: Seq[Try[T]]): Try[Seq[T]]

    Permalink

    Flatten a sequence of Trys to a try of sequence, which is a failure if any if the Trys is a failure.

  2. package byteable

    Permalink

    Utilities that help with byte serialization

  3. package config

    Permalink
  4. package info

    Permalink
  5. def map2HashMap[K, V](map: Map[K, V]): HashMap[K, V]

    Permalink

    Convert a Scala Map into a Java HashMap instance

  6. def map2Properties[K, V](map: Map[K, V]): Properties

    Permalink

    Convert a Scala Map into a Java Properties instance

  7. def timeCode[T](block: ⇒ T): (T, Long)

    Permalink

    Run a block and return the block result and the runtime in millis

  8. def tryWithCloseable[R <: AutoCloseable, T](resource: ⇒ R)(code: (R) ⇒ T): Try[T]

    Permalink

    Try running a code block that uses a resource which is silently closed on return.

    Try running a code block that uses a resource which is silently closed on return.

    R

    resource type which must be AutoCloseable

    T

    the code block return type

    resource

    resource creation block

    code

    code that uses the resource

    returns

    Success if the resource was successfully initialised and the code was successfully ran, even if the resource was not successfully closed.

Inherited from AnyRef

Inherited from Any

Ungrouped