copyWith method

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

Implementation

PortSpec copyWith({
  PortNum? num,
  int? hostPort,
  String? type,
  List<EndpointSpec>? endpoints,
  String? liveness,
  bool? public,
  bool? published,
  Map<String, String>? annotations,
}) {
  return PortSpec(
    num: num ?? this.num,
    hostPort: hostPort ?? this.hostPort,
    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,
  );
}