// Object equals method override – equality (Java7 or higher)
@Override
public boolean equals(Object other)
{
if (other == this) return true;
if (other instanceof Photo) {
Photo that = (Photo)other;
return Objects.equals(this.fullPath, that.fullPath) &&
Objects.equals(this.extension, that.extension) &&
this.width == that.width &&
this.height == that.height;
}
return false;
}
// Object hashCode method override – identity (Java7 or higher)
@Override
public int hashCode()
{
return Objects.hash(this.fullPath, this.extension, this.width, this.height);
}