CLASS
DataMapperBuilder
Contents
- Methods
init(redirectTo:autoPollingDuration:authSelectionPresentation:)
customize(modelType:handler:)
build()
public class DataMapperBuilder
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(redirectTo:autoPollingDuration:authSelectionPresentation:)
public init(redirectTo: String,
autoPollingDuration: TimeInterval,
authSelectionPresentation: AuthenticatorSelectionPresentation)
Initializes the Builder
with the mandatory parameters.
- Parameters:
- redirectTo: The client application's redirect URI.
- autoPollingDuration: A duration for the automatic polling mechanism.
- authSelectionPresentation: The configured
AuthenticatorSelectionPresentation
mode.
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:
- 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 toUIModel
and represents the input model.
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.
- Returns: An instance of
DataMapper