public boolean equals()

in messages/src/main/java/com/epam/deltix/timebase/messages/schema/EnumConstant.java [153:172]


  public boolean equals(Object obj) {
    if (this == obj) return true;
    if (!(obj instanceof EnumConstant)) return false;
    EnumConstant other =(EnumConstant)obj;
    if (hasSymbol() != other.hasSymbol()) return false;
    if (hasSymbol()) {
      if (getSymbol().length() != other.getSymbol().length()) return false; else {
        CharSequence s1 = getSymbol();
        CharSequence s2 = other.getSymbol();
        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 (hasValue() != other.hasValue()) return false;
    if (hasValue() && getValue() != other.getValue()) return false;
    return true;
  }