build method

  1. @override
AdaptiveCloner build()
override

Builds an AdaptiveCloner with the configured delegates and options.

Throws StateError if mapTypedDelegateBuilder.build does not return an IMapTypedCloning cloner.

Implementation

@override
AdaptiveCloner build() {
  final mtc = mapTypedDelegateBuilder.build();
  if (mtc is! IMapTypedCloning) {
    throw StateError(
      'mapTypedDelegateBuilder.build() did not return an IMapTypedCloning',
    );
  }

  return AdaptiveCloner._(
    _typedClone,
    isAOT,
    valueDelegateBuilder.build(),
    listTypedDelegateBuilder.build(),
    listDynamicDelegateBuilder.build(),
    setTypedDelegateBuilder.build(),
    setDynamicDelegateBuilder.build(),
    mtc as IMapTypedCloning,
    mapDynamicDelegateBuilder.build(),
  );
}