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 TcpPacket &&
      _v0 == other._v0 &&
      sequenceNumber == other.sequenceNumber &&
      acknowledgementNumber == other.acknowledgementNumber &&
      _v0 == other._v3 &&
      _v4 == other._v4 &&
      const ByteDataEquality().equals(
        optionsByteData,
        other.optionsByteData,
      ) &&
      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;
  }
}