public boolean equals()

in messages/src/main/java/com/epam/deltix/timebase/messages/service/StreamTruncatedMessage.java [194:217]


  public boolean equals(Object obj) {
    if (this == obj) return true;
    boolean superEquals = super.equals(obj);
    if (!superEquals) return false;
    if (!(obj instanceof StreamTruncatedMessage)) return false;
    StreamTruncatedMessage other =(StreamTruncatedMessage)obj;
    if (hasInstruments() != other.hasInstruments()) return false;
    if (hasInstruments()) {
      if (getInstruments().length() != other.getInstruments().length()) return false; else {
        CharSequence s1 = getInstruments();
        CharSequence s2 = other.getInstruments();
        if ((s1 instanceof MutableString && s2 instanceof MutableString) || (s1 instanceof String && s2 instanceof String) || (s1 instanceof BinaryAsciiString && s2 instanceof BinaryAsciiString)) {
          if (!s1.equals(s2)) return false;
        } else {
          if (!CharSequenceUtils.equals(s1, s2)) return false;
        }
      }
    }
    if (hasTruncateTime() != other.hasTruncateTime()) return false;
    if (hasTruncateTime() && getTruncateTime() != other.getTruncateTime()) return false;
    if (hasVersion() != other.hasVersion()) return false;
    if (hasVersion() && getVersion() != other.getVersion()) return false;
    return true;
  }