little.config

Type members

Classlikes

@FunctionalInterface
trait ConfigDelegate[T]

Gets T from config.

Gets T from config.

import com.typesafe.config.{ Config, ConfigFactory }
import little.config.{ ConfigDelegate, ConfigExt }

case class User(id: Int, name: String)

// Define how to get User from Config
given ConfigDelegate[User] with
  def get(config: Config, path: String): User =
    val user = config.getConfig(path)
    User(user.getInt("id"), user.getString("name"))

val config = ConfigFactory.parseString("user { id = 0, name = root }")

// Get User from Config
val user = config.get[User]("user")
final class ConfigExt(config: Config) extends AnyVal

Adds extension methods to com.typesafe.config.Config.

Adds extension methods to com.typesafe.config.Config.

Givens

Givens

Gets Boolean from config.

Gets Boolean from config.

Gets collection M[T] from config.

Gets collection M[T] from config.

Gets Config from config.

Gets Config from config.

Gets Double from config.

Gets Double from config.

Gets Duration from config.

Gets Duration from config.

Creates ConfigDelegate for getting Enum from config.

Creates ConfigDelegate for getting Enum from config.

Gets File from config.

Gets File from config.

Note

This gets a String and uses it as a pathname to create a File.

Gets Int from config.

Gets Int from config.

Gets Long from config.

Gets Long from config.

given memorySizeDelegate: ConfigDelegate[ConfigMemorySize]

Gets ConfigMemorySize from config.

Gets ConfigMemorySize from config.

Gets Period from config.

Gets Period from config.

Gets String from config.

Gets String from config.