CLASS
OAuthDataMapperBuilder
Contents
- Methods
init()customize(modelType:handler:)build()
public class OAuthDataMapperBuilder
A builder-pattern class, designed to build a DataMapper without the need to provide configuration from the underlying support framework behaviour.
- Experiment: This is an experimental API. It may be changed or removed in the future.
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:
- modelType: The type of custom TokenResponse specialization targeted to apply custom handling.
- handler: A closure responsible for taking a
HaapiResultContentmodel instance in and providing a model instance that conforms toUIModeland represents the input model.
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.
- Returns: An instance of
DataMapper