/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getSearchedFaceBoundingBox() != null) sb.append("SearchedFaceBoundingBox: ").append(getSearchedFaceBoundingBox()).append(","); if (getSearchedFaceConfidence() != null) sb.append("SearchedFaceConfidence: ").append(getSearchedFaceConfidence()).append(","); if (getFaceMatches() != null) sb.append("FaceMatches: ").append(getFaceMatches()).append(","); if (getFaceModelVersion() != null) sb.append("FaceModelVersion: ").append(getFaceModelVersion()); sb.append("}"); return sb.toString(); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getSearchedFaceBoundingBox() == null) ? 0 : getSearchedFaceBoundingBox().hashCode()); hashCode = prime * hashCode + ((getSearchedFaceConfidence() == null) ? 0 : getSearchedFaceConfidence().hashCode()); hashCode = prime * hashCode + ((getFaceMatches() == null) ? 0 : getFaceMatches().hashCode()); hashCode = prime * hashCode + ((getFaceModelVersion() == null) ? 0 : getFaceModelVersion().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof SearchFacesByImageResult == false) return false; SearchFacesByImageResult other = (SearchFacesByImageResult) obj; if (other.getSearchedFaceBoundingBox() == null ^ this.getSearchedFaceBoundingBox() == null) return false; if (other.getSearchedFaceBoundingBox() != null && other.getSearchedFaceBoundingBox().equals(this.getSearchedFaceBoundingBox()) == false) return false; if (other.getSearchedFaceConfidence() == null ^ this.getSearchedFaceConfidence() == null) return false; if (other.getSearchedFaceConfidence() != null && other.getSearchedFaceConfidence().equals(this.getSearchedFaceConfidence()) == false) return false; if (other.getFaceMatches() == null ^ this.getFaceMatches() == null) return false; if (other.getFaceMatches() != null && other.getFaceMatches().equals(this.getFaceMatches()) == false) return false; if (other.getFaceModelVersion() == null ^ this.getFaceModelVersion() == null) return false; if (other.getFaceModelVersion() != null && other.getFaceModelVersion().equals(this.getFaceModelVersion()) == false) return false; return true; }
/** * <p> * An array of faces that match the input face, along with the confidence in * the match. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param faceMatches <p> * An array of faces that match the input face, along with the * confidence in the match. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public SearchFacesByImageResult withFaceMatches(FaceMatch... faceMatches) { if (getFaceMatches() == null) { this.faceMatches = new java.util.ArrayList<FaceMatch>(faceMatches.length); } for (FaceMatch value : faceMatches) { this.faceMatches.add(value); } return this; }
/** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getSearchedFaceBoundingBox() != null) sb.append("SearchedFaceBoundingBox: " + getSearchedFaceBoundingBox() + ","); if (getSearchedFaceConfidence() != null) sb.append("SearchedFaceConfidence: " + getSearchedFaceConfidence() + ","); if (getFaceMatches() != null) sb.append("FaceMatches: " + getFaceMatches() + ","); if (getFaceModelVersion() != null) sb.append("FaceModelVersion: " + getFaceModelVersion()); sb.append("}"); return sb.toString(); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getSearchedFaceBoundingBox() == null) ? 0 : getSearchedFaceBoundingBox() .hashCode()); hashCode = prime * hashCode + ((getSearchedFaceConfidence() == null) ? 0 : getSearchedFaceConfidence() .hashCode()); hashCode = prime * hashCode + ((getFaceMatches() == null) ? 0 : getFaceMatches().hashCode()); hashCode = prime * hashCode + ((getFaceModelVersion() == null) ? 0 : getFaceModelVersion().hashCode()); return hashCode; }
&& other.getSearchedFaceConfidence().equals(this.getSearchedFaceConfidence()) == false) return false; if (other.getFaceMatches() == null ^ this.getFaceMatches() == null) return false; if (other.getFaceMatches() != null && other.getFaceMatches().equals(this.getFaceMatches()) == false) return false; if (other.getFaceModelVersion() == null ^ this.getFaceModelVersion() == null)