toJson method

Map<String, dynamic> toJson()

Converts the queue to a JSON representation.

Implementation

Map<String, dynamic> toJson() {
  return {
    'maxSize': maxSize,
    'enablePriority': enablePriority,
    'enableDeduplication': enableDeduplication,
    'size': size,
    'messages': _queue.map((message) => message.toJson()).toList(),
  };
}