CommandMappingsBuilder
open class CommandMappingsBuilder<
Command: CommandName,
Destination: JSONObjectPathConvertible
>: Mappings
Generic reusable base class for building vendor-specific mappings.
Subclasses Mappings and adds overloaded methods that accept type-safe
Command and Destination enums instead of raw strings.
Base Mappings methods (accepting String and JSONObjectPath) remain
available for cases not covered by the enums.
-
Maps a command to the command name destination.
Declaration
Swift
@discardableResult public func mapCommand(_ command: Command) -> CommandOptions -
Maps a source key to a typed destination.
Declaration
Swift
@discardableResult public func mapFrom(_ key: String, to destination: Destination) -> VariableOptions -
Maps a source path to a typed destination.
Declaration
Swift
@discardableResult public func mapFrom(_ path: JSONObjectPath, to destination: Destination) -> VariableOptions -
Maps a constant value to a typed destination.
Declaration
Swift
@discardableResult public func mapConstant(_ value: DataInput, to destination: Destination) -> ConstantOptions -
Keeps a typed destination (source and destination are the same).
Declaration
Swift
@discardableResult public func keep(_ destination: Destination) -> VariableOptions
View on GitHub