ConfigUtil

object ConfigUtil

Contains static utility methods.

Contains static utility methods.

Companion
class
class Object
trait Matchable
class Any

Value members

Concrete methods

@varargs
def joinPath(elements: String*): String

Converts a list of keys to a path expression, by quoting the path elements as needed and then joining them separated by a period. A path expression is usable with a [[Config]], while individual path elements are usable with a [[ConfigObject]].

Converts a list of keys to a path expression, by quoting the path elements as needed and then joining them separated by a period. A path expression is usable with a [[Config]], while individual path elements are usable with a [[ConfigObject]].

See the overview documentation for [[Config]] for more detail on path expressions vs. keys.

Value Params
elements

the keys in the path

Returns

a path expression

Throws
ConfigException

if there are no elements

def joinPath(elements: List[String]): String

Converts a list of strings to a path expression, by quoting the path elements as needed and then joining them separated by a period. A path expression is usable with a [[Config]], while individual path elements are usable with a [[ConfigObject]].

Converts a list of strings to a path expression, by quoting the path elements as needed and then joining them separated by a period. A path expression is usable with a [[Config]], while individual path elements are usable with a [[ConfigObject]].

See the overview documentation for [[Config]] for more detail on path expressions vs. keys.

Value Params
elements

the keys in the path

Returns

a path expression

Throws
ConfigException

if the list is empty

def quoteString(s: String): String

Quotes and escapes a string, as in the JSON specification.

Quotes and escapes a string, as in the JSON specification.

Value Params
s

a string

Returns

the string quoted and escaped

def splitPath(path: String): List[String]

Converts a path expression into a list of keys, by splitting on period and unquoting the individual path elements. A path expression is usable with a [[Config]], while individual path elements are usable with a [[ConfigObject]].

Converts a path expression into a list of keys, by splitting on period and unquoting the individual path elements. A path expression is usable with a [[Config]], while individual path elements are usable with a [[ConfigObject]].

See the overview documentation for [[Config]] for more detail on path expressions vs. keys.

Value Params
path

a path expression

Returns

the individual keys in the path

Throws
ConfigException

if the path expression is invalid