metron-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mmiklavc <...@git.apache.org>
Subject [GitHub] metron pull request #1254: METRON-1849 Elasticsearch Index Write Functionali...
Date Tue, 04 Dec 2018 23:50:12 GMT
Github user mmiklavc commented on a diff in the pull request:

    https://github.com/apache/metron/pull/1254#discussion_r238876879
  
    --- Diff: metron-platform/metron-indexing/src/main/java/org/apache/metron/indexing/dao/update/Document.java
---
    @@ -89,46 +91,29 @@ public void setGuid(String guid) {
         this.guid = guid;
       }
     
    -  @Override
    -  public String toString() {
    -    return "Document{" +
    -        "timestamp=" + timestamp +
    -        ", document=" + document +
    -        ", guid='" + guid + '\'' +
    -        ", sensorType='" + sensorType + '\'' +
    -        '}';
    -  }
    -
       @Override
       public boolean equals(Object o) {
    -    if (this == o) {
    -      return true;
    -    }
    -    if (o == null || getClass() != o.getClass()) {
    -      return false;
    -    }
    -
    +    if (this == o) return true;
    +    if (!(o instanceof Document)) return false;
         Document document1 = (Document) o;
    -
    -    if (timestamp != null ? !timestamp.equals(document1.timestamp) : document1.timestamp
!= null) {
    -      return false;
    -    }
    -    if (document != null ? !document.equals(document1.document) : document1.document
!= null) {
    -      return false;
    -    }
    -    if (guid != null ? !guid.equals(document1.guid) : document1.guid != null) {
    -      return false;
    -    }
    -    return sensorType != null ? sensorType.equals(document1.sensorType)
    -        : document1.sensorType == null;
    +    return Objects.equals(timestamp, document1.timestamp) &&
    --- End diff --
    
    Is this change to equals and hashcode an auto-create from IntelliJ?


---

Mime
View raw message