mergedWith method

CallOptions mergedWith(
  1. CallOptions? other
)

Implementation

CallOptions mergedWith(CallOptions? other) {
  if (other == null) return this;
  final mergedMetadata = Map.from(metadata)..addAll(other.metadata);
  final mergedTimeout = other.timeout ?? timeout;
  final mergedProviders = List.from(metadataProviders)
    ..addAll(other.metadataProviders);
  final mergedCompression = other.compression ?? compression;
  return CallOptions._(
    Map.unmodifiable(mergedMetadata),
    mergedTimeout,
    List.unmodifiable(mergedProviders),
    mergedCompression,
  );
}