copyWith method

PortSpec copyWith({
  1. PortNum? num,
  2. String? type,
  3. List<EndpointSpec>? endpoints,
  4. String? liveness,
  5. bool? public,
  6. bool? published,
  7. Map<String, String>? annotations,
})

Implementation

PortSpec copyWith({
  PortNum? num,
  String? type,
  List<EndpointSpec>? endpoints,
  String? liveness,
  bool? public,
  bool? published,
  Map<String, String>? annotations,
}) {
  return PortSpec(
    num: num ?? this.num,
    type: type ?? this.type,
    endpoints: endpoints ?? List<EndpointSpec>.from(this.endpoints),
    liveness: liveness ?? this.liveness,
    published: published ?? this.published,
    public: public ?? this.public,
    annotations: annotations ?? this.annotations,
  );
}