tuweni / org.apache.tuweni.config / Configuration

Configuration

interface Configuration (source)

Represents collection of configuration properties, optionally validated against a schema.

Functions

canonicalKey

Get the canonical form of a configuration key.

open static fun canonicalKey(key: String!): String!

contains

Check if a key is set in this configuration.

abstract fun contains(key: String!): Boolean

empty

Get an empty configuration, with no values.

open static fun empty(): Configuration!

Get an empty configuration, associated with a validation schema.

open static fun empty(schema: Schema?): Configuration!

errors

The errors that occurred during parsing.

abstract fun errors(): MutableList<ConfigurationError!>!

fromToml

Read a configuration from a TOML-formatted string.

open static fun fromToml(toml: String!): Configuration!

Read a configuration from a TOML-formatted string, associated with a validation schema.

open static fun fromToml(toml: String!, schema: Schema?): Configuration!

Loads a configuration from a TOML-formatted file.

open static fun fromToml(file: Path!): Configuration!
open static fun fromToml(is: InputStream!): Configuration!

Loads a configuration from a file, associated with a validation schema.

open static fun fromToml(file: Path!, schema: Schema?): Configuration!
open static fun fromToml(is: InputStream!, schema: Schema?): Configuration!

get

Get an object from this configuration.

abstract fun get(key: String!): Any?

getBoolean

Get a boolean from this configuration.

abstract fun getBoolean(key: String!): Boolean

getConfigurationSection

Provides a section of the configuration

abstract fun getConfigurationSection(name: String!): Configuration!

getDouble

Get a double from this configuration.

abstract fun getDouble(key: String!): Double

getInteger

Get an integer from this configuration.

abstract fun getInteger(key: String!): Int

getList

Get a list from this configuration.

abstract fun getList(key: String!): MutableList<Any!>!

getListOfBoolean

Get a list of booleans from this configuration.

abstract fun getListOfBoolean(key: String!): MutableList<Boolean!>!

getListOfDouble

Get a list of doubles from this configuration.

abstract fun getListOfDouble(key: String!): MutableList<Double!>!

getListOfInteger

Get a list of integers from this configuration.

abstract fun getListOfInteger(key: String!): MutableList<Int!>!

getListOfLong

Get a list of longs from this configuration.

abstract fun getListOfLong(key: String!): MutableList<Long!>!

getListOfMap

Get a list of maps from this configuration.

abstract fun getListOfMap(key: String!): MutableList<MutableMap<String!, Any!>!>!

getListOfString

Get a list of strings from this configuration.

abstract fun getListOfString(key: String!): MutableList<String!>!

getLong

Get a long from this configuration.

abstract fun getLong(key: String!): Long

getMap

Get a map from this configuration.

abstract fun getMap(key: String!): MutableMap<String!, Any!>!

getString

Get a string from this configuration.

abstract fun getString(key: String!): String!

hasErrors

Returns true if the document has errors.

open fun hasErrors(): Boolean

inputPositionOf

Get the position where a key is defined in the TOML document.

abstract fun inputPositionOf(key: String!): DocumentPosition?

keySet

The keys of all entries present in this configuration.

abstract fun keySet(): MutableSet<String!>!

The keys of all entries present in this configuration under a given prefix.

abstract fun keySet(prefix: String!): MutableSet<String!>!

sections

The names of the sections defined under a given prefix.

abstract fun sections(prefix: String!): MutableSet<String!>!

toToml

Get a TOML-formatted representation of this configuration.

open fun toToml(): String!

Save a configuration to a TOML-formatted file.

open fun toToml(path: Path!): Unit

Writes a configuration in TOML format.

abstract fun toToml(appendable: Appendable!): Unit