intercom/intercom-java

Simplify .equals code

Opened this issue · 0 comments

Current code utilises the following format to check for object equality in .equals methods e.g.

if (website != null ? !website.equals(company.website) : company.website != null) return false;

This is hard to read and could be simplified

Possible solution:

if (!Objects.equals(website, company.website)) return false;

image

Raised in https://github.com/intercom/intercom-java/pull/183/files#r206175113

Till need to discuss the possibility of adding and enforcing Java 7 minimum version if we were to implement this