ConfigurationKey

open class ConfigurationKey<T>

An abstract class for typed configuration key.

  • The relative key path.

    Declaration

    Swift

    public let path: [String]
  • The default key value.

    Declaration

    Swift

    public let defaultValue: T?
  • The key to forward the default value from.

    Declaration

    Swift

    public let forwardKey: ConfigurationKey<T>?
  • Returns the deserialized value.

    Declaration

    Swift

    open func map(_ json: JSON) -> T?
  • Returns the serialized value.

    Declaration

    Swift

    open func map(_ value: T) -> JSON
  • Create the key for the given path and provide the defaultValue to it.

    Declaration

    Swift

    public init(_ path: [String], _ defaultValue: T)
  • Create the key for the given path and provide the key path to get the default value from.

    Declaration

    Swift

    public init(_ path: [String], forwardFrom: ConfigurationKey<T>)