CLASS

OAuthDataMapperBuilder

Contents

public class OAuthDataMapperBuilder

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

Methods

init()

public init()

Initializes the Builder.

customize(modelType:handler:)

public func customize<T: OAuthResponse>(
    modelType: T.Type,
    handler: @escaping OAuthModelFactory
) -> OAuthDataMapperBuilder

Sets a custom data mapping closure handler resolver for a model type. The provided model type must conform to the frameworks UIModel based protocols otherwise the framework cannot handle it and errors may occur.

Parameters

Name Description
modelType The type of custom TokenResponse 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() -> OAuthDataMapper

Builds the OAuthDataMapper for the provided configuration.