Key

abstract class Key[T]

A configuration key

Companion:
object
class Object
trait Matchable
class Any

Value members

Abstract methods

def asString(value: T): Seq[String]

Converts a value of this key to a sequence of strings

Converts a value of this key to a sequence of strings

Such a sequence can be printed in the console, and converted back to a T with fromString.

def fromString(values: Seq[String]): Either[MalformedValue, T]

Reads a value of this key from a sequence of string

Reads a value of this key from a sequence of string

def name: String

Key name, such as "b" in "foo.a.b"

Key name, such as "b" in "foo.a.b"

def parse(json: Array[Byte]): Either[EntryError, T]

Try to parse a value of this key

Try to parse a value of this key

def prefix: Seq[String]

Key prefix, such as "foo.a" in "foo.a.b"

Key prefix, such as "foo.a" in "foo.a.b"

def write(value: T): Array[Byte]

Converts a value of this key to JSON

Converts a value of this key to JSON

Returns:

UTF-8 encoded JSON

Concrete methods

final def fullName: String

The fully qualified name of this key

The fully qualified name of this key

def isPasswordOption: Boolean

Whether this key corresponds to a password (see Key.PasswordEntry)

Whether this key corresponds to a password (see Key.PasswordEntry)