toJson method

Map<String, Object> toJson()

Converts a NodeSelectorRequirement instance to JSON data.

Implementation

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

  final tempKey = key;
  final tempOperator = operator;
  final tempValues = values;

  jsonData['key'] = tempKey;

  jsonData['operator'] = tempOperator;

  if (tempValues != null) {
    jsonData['values'] = tempValues;
  }

  return jsonData;
}