public boolean equals()

in firebase-inappmessaging/src/main/java/com/google/firebase/inappmessaging/model/CardMessage.java [55:91]


  public boolean equals(Object o) {
    if (o == this) {
      return true; // same instance
    }
    if (!(o instanceof CardMessage)) {
      return false; // not the correct instance type
    }
    CardMessage c = (CardMessage) o;
    if (hashCode() != c.hashCode()) {
      return false; // the hashcodes don't match
    }
    if ((body == null && c.body != null) || (body != null && !body.equals(c.body))) {
      return false; // the bodies don't match
    }
    if ((secondaryAction == null && c.secondaryAction != null)
        || (secondaryAction != null && !secondaryAction.equals(c.secondaryAction))) {
      return false; // the secondary actions don't match
    }
    if ((portraitImageData == null && c.portraitImageData != null)
        || (portraitImageData != null && !portraitImageData.equals(c.portraitImageData))) {
      return false; // the portrait image data don't match
    }
    if ((landscapeImageData == null && c.landscapeImageData != null)
        || (landscapeImageData != null && !landscapeImageData.equals(c.landscapeImageData))) {
      return false; // the landscape image data don't match
    }
    if (!title.equals(c.title)) {
      return false; // the titles don't match
    }
    if (!primaryAction.equals(c.primaryAction)) {
      return false; // the primary actions don't match
    }
    if (backgroundHexColor.equals(c.backgroundHexColor)) {
      return true; // everything matches
    }
    return false;
  }