ObjectConfig

laika.config.ObjectConfig
class ObjectConfig(val root: ObjectValue, val origin: Origin, val fallback: Config) extends Config

The default implementation of the Config API.

Attributes

Graph
Supertypes
trait Config
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

override def equals(obj: Any): Boolean

Compares the receiver object (this) with the argument object (that) for equivalence.

Compares the receiver object (this) with the argument object (that) for equivalence.

Any implementation of this method should be an equivalence relation:

  • It is reflexive: for any instance x of type Any, x.equals(x) should return true.
  • It is symmetric: for any instances x and y of type Any, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any instances x, y, and z of type Any if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.

If you override this method, you should verify that your implementation remains an equivalence relation. Additionally, when overriding this method it is usually necessary to override hashCode to ensure that objects which are "equal" (o1.equals(o2) returns true) hash to the same scala.Int. (o1.hashCode.equals(o2.hashCode)).

Value parameters

that

the object to compare against this object for equality.

Attributes

Returns

true if the receiver object is equivalent to the argument; false otherwise.

Definition Classes
Any
def get[T](key: Key)(implicit decoder: ConfigDecoder[T]): ConfigResult[T]

Retrieve a required value for the specified key and decoder.

Retrieve a required value for the specified key and decoder.

Attributes

def hasKey(key: Key): Boolean

Verifies whether this config instance contains a value mapped to the specified key.

Verifies whether this config instance contains a value mapped to the specified key.

Attributes

override def hashCode: Int

Calculate a hash code value for the object.

Calculate a hash code value for the object.

The default hashing algorithm is platform dependent.

Note that it is allowed for two objects to have identical hash codes (o1.hashCode.equals(o2.hashCode)) yet not be equal (o1.equals(o2) returns false). A degenerate implementation could always return 0. However, it is required that if two objects are equal (o1.equals(o2) returns true) that they have identical hash codes (o1.hashCode.equals(o2.hashCode)). Therefore, when overriding this method, be sure to verify that the behavior is consistent with the equals method.

Attributes

Returns

the hash code value for this object.

Definition Classes
Any
def withFallback(other: Config): Config

Returns a new configuration instance using the specified instance as a fallback for keys not found in this instance.

Returns a new configuration instance using the specified instance as a fallback for keys not found in this instance.

If this instance already has a fallback, the new fallback will be passed further down the chain.

Attributes

def withOrigin(newOrigin: Origin): Config

Returns a new configuration instance using the specified origin.

Returns a new configuration instance using the specified origin.

Attributes

Inherited methods

def get[T](implicit decoder: ConfigDecoder[T], defaultKey: DefaultKey[T]): ConfigResult[T]

Retrieve a required value for the specified implicit key and decoder.

Retrieve a required value for the specified implicit key and decoder.

A defaultKey can be used for commonly used configuration objects like AutonumberConfig that are expected to be mapped to a specific key, like autonumbering.

Attributes

Inherited from:
Config
def get[T](key: String, default: => T)(implicit decoder: ConfigDecoder[T]): ConfigResult[T]

Retrieve an optional value for the specified key and decoder, falling back to the given default if the value is missing.

Retrieve an optional value for the specified key and decoder, falling back to the given default if the value is missing.

Attributes

Inherited from:
Config
def get[T](key: Key, default: => T)(implicit decoder: ConfigDecoder[T]): ConfigResult[T]

Retrieve an optional value for the specified key and decoder, falling back to the given default if the value is missing.

Retrieve an optional value for the specified key and decoder, falling back to the given default if the value is missing.

Attributes

Inherited from:
Config
def get[T](key: String)(implicit decoder: ConfigDecoder[T]): ConfigResult[T]

Retrieve a required value for the specified key and decoder.

Retrieve a required value for the specified key and decoder.

Attributes

Inherited from:
Config
def getOpt[T](key: String)(implicit decoder: ConfigDecoder[T]): ConfigResult[Option[T]]

Retrieve an optional value for the specified key and decoder. The result is still an Either as this method might still fail even if the value is present in case the decoding fails.

Retrieve an optional value for the specified key and decoder. The result is still an Either as this method might still fail even if the value is present in case the decoding fails.

Attributes

Inherited from:
Config
def getOpt[T](implicit decoder: ConfigDecoder[T], defaultKey: DefaultKey[T]): ConfigResult[Option[T]]

Retrieve an optional value for the specified implicit key and decoder.

Retrieve an optional value for the specified implicit key and decoder.

A defaultKey can be used for commonly used configuration objects like AutonumberConfig that are expected to be mapped to a specific key, like autonumbering.

The result is still an Either as this method might still fail even if the value is present in case the decoding fails.

Attributes

Inherited from:
Config
def getOpt[T](key: Key)(implicit decoder: ConfigDecoder[T]): ConfigResult[Option[T]]

Retrieve an optional value for the specified key and decoder. The result is still an Either as this method might still fail even if the value is present in case the decoding fails.

Retrieve an optional value for the specified key and decoder. The result is still an Either as this method might still fail even if the value is present in case the decoding fails.

Attributes

Inherited from:
Config
def hasKey(key: String): Boolean

Verifies whether this config instance contains a value mapped to the specified key.

Verifies whether this config instance contains a value mapped to the specified key.

Attributes

Inherited from:
Config
def withValue[T](value: T)(implicit encoder: ConfigEncoder[T], defaultKey: DefaultKey[T]): ConfigBuilder

Creates a new configuration builder with the specified value and this instance as a fallback. The returned builder can be used to add further values before calling build to retrieve a new instance.

Creates a new configuration builder with the specified value and this instance as a fallback. The returned builder can be used to add further values before calling build to retrieve a new instance.

Attributes

Inherited from:
Config
def withValue[T](key: Key, value: T)(implicit encoder: ConfigEncoder[T]): ConfigBuilder

Creates a new configuration builder with the specified value and this instance as a fallback. The returned builder can be used to add further values before calling build to retrieve a new instance.

Creates a new configuration builder with the specified value and this instance as a fallback. The returned builder can be used to add further values before calling build to retrieve a new instance.

Attributes

Inherited from:
Config
def withValue[T](key: String, value: T)(implicit encoder: ConfigEncoder[T]): ConfigBuilder

Creates a new configuration builder with the specified value and this instance as a fallback. The returned builder can be used to add further values before calling build to retrieve a new instance.

Creates a new configuration builder with the specified value and this instance as a fallback. The returned builder can be used to add further values before calling build to retrieve a new instance.

Attributes

Inherited from:
Config

Concrete fields

val origin: Origin

The origin of this configuration, which might come from programmatic configuration, a file in one of the input directories, a configuration header in a markup document or from an attribute section in a directive.

The origin of this configuration, which might come from programmatic configuration, a file in one of the input directories, a configuration header in a markup document or from an attribute section in a directive.

Attributes