CLASS

DataMapperBuilder

Contents

public class DataMapperBuilder

A builder-pattern class, designed to build a DataMapper without the need to provide configuration from the underlying support framework behaviour.

Methods

init(redirectTo:autoPollingDuration:authSelectionPresentation:)

public init(redirectTo: String,
            autoPollingDuration: TimeInterval,
            authSelectionPresentation: AuthenticatorSelectionPresentation)

Initializes the Builder with the mandatory parameters.

Parameters

Name Description
redirectTo The client application’s redirect URI.
autoPollingDuration A duration for the automatic polling mechanism.
authSelectionPresentation The configured AuthenticatorSelectionPresentation mode.

customize(modelType:handler:)

public func customize<T: HaapiResponse>(
    modelType: T.Type,
    handler: @escaping UIModelFactory
) -> DataMapperBuilder

Sets a custom data mapping closure handler resolver for a model type. The provided modelType must conform to the frameworks HaapiResponse type hierarchy otherwise the framework may not handle resolution correctly and may display some unexpected behaviour.

Parameters

Name Description
modelType The type of custom HaapiRepresentation specialization targeted to apply custom handling.
handler A closure responsible for taking a HaapiResultContent model instance in and providing a model instance that conforms to UIModel and represents the input model.

build()

public func build() -> DataMapper

Builds the DataMapper for the provided configuration.