copyWith method

Configuration copyWith({
  1. String? apiKey,
  2. Set<Node>? nodes,
  3. Node? nearestNode,
  4. int? numRetries,
  5. Duration? retryInterval,
  6. Duration? connectionTimeout,
  7. Duration? healthcheckInterval,
  8. Duration? cachedSearchResultsTTL,
  9. bool? sendApiKeyAsQueryParam,
})

Returns a new Configuration object which differs only in the specified values from this object.

Implementation

Configuration copyWith({
  String? apiKey,
  Set<Node>? nodes,
  Node? nearestNode,
  int? numRetries,
  Duration? retryInterval,
  Duration? connectionTimeout,
  Duration? healthcheckInterval,
  Duration? cachedSearchResultsTTL,
  bool? sendApiKeyAsQueryParam,
}) =>
    Configuration(
      apiKey ?? this.apiKey,
      nodes: nodes ?? this.nodes,
      nearestNode: nearestNode ?? this.nearestNode,
      numRetries: numRetries ?? this.numRetries,
      retryInterval: retryInterval ?? this.retryInterval,
      connectionTimeout: connectionTimeout ?? this.connectionTimeout,
      healthcheckInterval: healthcheckInterval ?? this.healthcheckInterval,
      cachedSearchResultsTTL:
          cachedSearchResultsTTL ?? this.cachedSearchResultsTTL,
      sendApiKeyAsQueryParam:
          sendApiKeyAsQueryParam ?? this.sendApiKeyAsQueryParam,
    );