Map

public final class Map

A class used for holding mapping data

  • Sets the current mapper value and key. The Key paramater can be a period separated string (ex. distance.value) to access sub objects.

    Declaration

    Swift

    public subscript(key: String) -> Map
  • Returns a value or throws an error.

    Declaration

    Swift

    public func value<T>(_ key: String, nested: Bool? = nil, delimiter: String = ".", file: StaticString = #file, function: StaticString = #function, line: UInt = #line) throws -> T
  • Returns a transformed value or throws an error.

    Declaration

    Swift

    public func value<Transform: TransformType>(_ key: String, nested: Bool? = nil, delimiter: String = ".", using transform: Transform, file: StaticString = #file, function: StaticString = #function, line: UInt = #line) throws -> Transform.Object
  • Returns a RawRepresentable type or throws an error.

    Declaration

    Swift

    public func value<T: RawRepresentable>(_ key: String, nested: Bool? = nil, delimiter: String = ".", file: StaticString = #file, function: StaticString = #function, line: UInt = #line) throws -> T
  • Returns a [BaseMappable] or throws an error.

    Declaration

    Swift

    public func value<T: BaseMappable>(_ key: String, nested: Bool? = nil, delimiter: String = ".", file: StaticString = #file, function: StaticString = #function, line: UInt = #line) throws -> [T]
  • Returns a [BaseMappable] using transform or throws an error.

    Declaration

    Swift

    public func value<Transform: TransformType>(_ key: String, nested: Bool? = nil, delimiter: String = ".", using transform: Transform, file: StaticString = #file, function: StaticString = #function, line: UInt = #line) throws -> [Transform.Object]
  • Returns a [String: BaseMappable] or throws an error.

    Declaration

    Swift

    public func value<T: BaseMappable>(_ key: String, nested: Bool? = nil, delimiter: String = ".", file: StaticString = #file, function: StaticString = #function, line: UInt = #line) throws -> [String: T]
  • Returns a [String: BaseMappable] using transform or throws an error.

    Declaration

    Swift

    public func value<Transform: TransformType>(_ key: String, nested: Bool? = nil, delimiter: String = ".", using transform: Transform, file: StaticString = #file, function: StaticString = #function, line: UInt = #line) throws -> [String: Transform.Object]