copyWith method

BaseRolloutStrategy copyWith({
  1. String? id,
  2. int? percentage,
  3. List<String>? percentageAttributes,
  4. dynamic value,
  5. List<BaseRolloutStrategyAttribute>? attributes,
})

Implementation

BaseRolloutStrategy copyWith({
  String? id,
  int? percentage,
  List<String>? percentageAttributes,
  dynamic value,
  List<BaseRolloutStrategyAttribute>? attributes,
}) {
  final _copy_id = id ?? this.id;

  final _copy_percentage = percentage ?? this.percentage;

  final _copy_percentageAttributes = percentageAttributes ??
      ((List<String> data) {
        return data.toList();
      }(this.percentageAttributes));

  final _copy_value = value ?? this.value;

  final _copy_attributes = attributes ??
      ((List<BaseRolloutStrategyAttribute> data) {
        return data.map((data) => data.copyWith()).toList();
      }(this.attributes));

  return BaseRolloutStrategy(
    id: _copy_id,
    percentage: _copy_percentage,
    percentageAttributes: _copy_percentageAttributes,
    value: _copy_value,
    attributes: _copy_attributes,
  );
}