ProfigPath

profig.ProfigPath
See theProfigPath companion object

ProfigPath is the core of functionality in Profig. Profig extends from it for the root path and is used for looking up deeper paths as well.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Profig
object Profig.type

Members list

Value members

Abstract methods

def path: JsonPath

Concrete methods

def apply(path: String*): ProfigPath

Look up a deeper path below the current path.

Look up a deeper path below the current path.

Attributes

Returns

ProfigPath

def apply(path: JsonPath): ProfigPath
def apply(): Json

Returns a Json representation of this path. Works similar to get(), except will return an empty Json object if there is nothing at this level.

Returns a Json representation of this path. Works similar to get(), except will return an empty Json object if there is nothing at this level.

Attributes

Returns

Json

def as[T : RW]: T

Loads this path out as the defined type T.

Loads this path out as the defined type T.

Type parameters

T

the type to represent the current path

Attributes

Returns

T

def asOr[T : RW](default: => T): T

Loads this path out as the defined type T. If no value is set for this path, the default will be used.

Loads this path out as the defined type T. If no value is set for this path, the default will be used.

Type parameters

T

the type to represent the current path

Value parameters

default

the default to be used if this path is empty

Attributes

Returns

T

def exists(): Boolean

True if this path exists in the config

True if this path exists in the config

Attributes

def get(): Option[Json]

Returns a Json representation of this path if there is anything defined at this level.

Returns a Json representation of this path if there is anything defined at this level.

Attributes

Returns

Option[Json]

def map(keys: (String, String)*): Unit

Maps from an existing key (if found) to a new key within this path. This is sort of like aliasing from one key to a new key, but it will actually copy the values.

Maps from an existing key (if found) to a new key within this path. This is sort of like aliasing from one key to a new key, but it will actually copy the values.

Value parameters

keys

(from, to)

Attributes

def merge(json: Json, `type`: MergeType): Unit

Merges a Json object to this path.

Merges a Json object to this path.

Attributes

def opt[T : RW]: Option[T]

Convenience functionality similar to as but returns an option if set.

Convenience functionality similar to as but returns an option if set.

Type parameters

T

the type to represent the current path

Attributes

Returns

T

def remove(field: String): Unit

Removes a field from this path.

Removes a field from this path.

Value parameters

field

the field below this path to remove

Attributes

def remove(): Unit

Removes this path

Removes this path

Attributes

def store[T : RW](value: T): Unit

Stores the supplied value into this path.

Stores the supplied value into this path.

Type parameters

T

the type of value

Value parameters

value

the value to store

Attributes

Inherited methods

def initConfiguration(startPath: Path, additionalPaths: List[Path], recursiveParents: Boolean, includeClassPath: Boolean, fileNameMatcher: FileNameMatcher, errorHandler: Option[Throwable => Unit]): Unit

Attributes

Inherited from:
ProfigPathPlatform
def load(fileName: String, source: Source, mergeType: MergeType, errorHandler: Option[Throwable => Unit]): Unit

Attributes

Inherited from:
ProfigPathPlatform
def loadConfiguration(startPath: Path, additionalPaths: List[Path], recursiveParents: Boolean, includeClassPath: Boolean, fileNameMatcher: FileNameMatcher, errorHandler: Option[Throwable => Unit]): Unit

Attributes

Inherited from:
ProfigPathPlatform
def loadFile(file: File, mergeType: MergeType, errorHandler: Option[Throwable => Unit]): Unit

Attributes

Inherited from:
ProfigPathPlatform