AggregateTransformer
public struct AggregateTransformer<Input, Output> : Transformer
A transformer that aggregates multiple transformers. Multiple aggregate transformers can be chained.
-
Creates a new instance of
AggregateTransformerthat will pass values in tofirstTransformer, then pass the output fromfirstTransformerin tosecondTransformer.Declaration
Swift
public init<FirstTransformer: Transformer, SecondTransformer: Transformer>( firstTransformer: FirstTransformer, secondTransformer: SecondTransformer ) where FirstTransformer.Input == Input, FirstTransformer.Output == SecondTransformer.Input, SecondTransformer.Output == OutputParameters
firstTransformerThe first transformer to call when transforming values.
secondTransformerThe second transformer to call when transforming values.
-
Transform the provided value by passing it to the first transformer, then the second transformer.
Throws
Any errors thrown by the transformers.Declaration
Swift
public func transformValue(_ value: Input) throws -> OutputParameters
valueThe value to transform
Return Value
The value returned bt the second transformer.
-
Transform the provided value by passing it to the second transformer, then the first transformer.
Throws
Any errors thrown by the transformers.Declaration
Swift
public func untransformValue(_ value: Output) throws -> InputParameters
valueThe value to transform
Return Value
The value returned bt the first transformer.
View on GitHub
AggregateTransformer Structure Reference