operator == method
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;
}
}