ConstantOptions

public class ConstantOptions : MappingsBuilder

Some Mappings options that are mapping a constant value to a destination in the result payload.

  • Sets an optional basic condition that the value at the given mapping path needs to match in order for this mapping to take place, where the variable may be found in a path at the root or in any nested JSON object and JSON array of the data layer.

    Declaration

    Swift

    public func ifValueIn(_ path: JSONObjectPath, equals target: String)

    Parameters

    path

    The path to take the value from when comparing against the expected value.

    target

    The target value that the source key should contain.

  • Sets an optional basic condition that the value at the given mapping key needs to match in order for this mapping to take place, where the variable may be found in a key at the root of the data layer.

    Declaration

    Swift

    public func ifValueIn(_ key: String, equals target: String)

    Parameters

    key

    The key to take the value from when comparing against the expected value.

    target

    The target value that the source key should contain.