operator == method

  1. @override
bool operator ==(
  1. Object other
)

Compares this object with another SelfEncoder by serialized content.

Implementation

@override
bool operator ==(Object other) {
  if (other is UdpPacket &&
      sourcePort == other.sourcePort &&
      destinationPort == other.destinationPort &&
      payload == other.payload) {
    final parent = parentPacket;
    final otherParent = other.parentPacket;
    if (parent == null) {
      return otherParent == null;
    }
    return parent.source == otherParent?.source &&
        parent.destination == otherParent?.destination;
  } else {
    return false;
  }
}