toJson method

Map<String, Object> toJson()

Converts a NodeSelectorTerm instance to JSON data.

Implementation

Map<String, Object> toJson() {
  final jsonData = <String, Object>{};

  final tempMatchExpressions = matchExpressions;
  final tempMatchFields = matchFields;

  if (tempMatchExpressions != null) {
    jsonData['matchExpressions'] =
        tempMatchExpressions.map((e) => e.toJson()).toList(growable: false);
  }

  if (tempMatchFields != null) {
    jsonData['matchFields'] =
        tempMatchFields.map((e) => e.toJson()).toList(growable: false);
  }

  return jsonData;
}