/** * 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 (getSourceImageFace() != null) sb.append("SourceImageFace: ").append(getSourceImageFace()).append(","); if (getFaceMatches() != null) sb.append("FaceMatches: ").append(getFaceMatches()).append(","); if (getUnmatchedFaces() != null) sb.append("UnmatchedFaces: ").append(getUnmatchedFaces()).append(","); if (getSourceImageOrientationCorrection() != null) sb.append("SourceImageOrientationCorrection: ").append(getSourceImageOrientationCorrection()).append(","); if (getTargetImageOrientationCorrection() != null) sb.append("TargetImageOrientationCorrection: ").append(getTargetImageOrientationCorrection()); sb.append("}"); return sb.toString(); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getSourceImageFace() == null) ? 0 : getSourceImageFace().hashCode()); hashCode = prime * hashCode + ((getFaceMatches() == null) ? 0 : getFaceMatches().hashCode()); hashCode = prime * hashCode + ((getUnmatchedFaces() == null) ? 0 : getUnmatchedFaces().hashCode()); hashCode = prime * hashCode + ((getSourceImageOrientationCorrection() == null) ? 0 : getSourceImageOrientationCorrection().hashCode()); hashCode = prime * hashCode + ((getTargetImageOrientationCorrection() == null) ? 0 : getTargetImageOrientationCorrection().hashCode()); return hashCode; }
if (other.getFaceMatches() != null && other.getFaceMatches().equals(this.getFaceMatches()) == false) return false; if (other.getUnmatchedFaces() == null ^ this.getUnmatchedFaces() == null) return false; if (other.getUnmatchedFaces() != null && other.getUnmatchedFaces().equals(this.getUnmatchedFaces()) == false) return false; if (other.getSourceImageOrientationCorrection() == null ^ this.getSourceImageOrientationCorrection() == null)
/** * <p> * An array of faces in the target image that did not match the source image * face. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param unmatchedFaces <p> * An array of faces in the target image that did not match the * source image face. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public CompareFacesResult withUnmatchedFaces(ComparedFace... unmatchedFaces) { if (getUnmatchedFaces() == null) { this.unmatchedFaces = new java.util.ArrayList<ComparedFace>(unmatchedFaces.length); } for (ComparedFace value : unmatchedFaces) { this.unmatchedFaces.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 (getSourceImageFace() != null) sb.append("SourceImageFace: " + getSourceImageFace() + ","); if (getFaceMatches() != null) sb.append("FaceMatches: " + getFaceMatches() + ","); if (getUnmatchedFaces() != null) sb.append("UnmatchedFaces: " + getUnmatchedFaces() + ","); if (getSourceImageOrientationCorrection() != null) sb.append("SourceImageOrientationCorrection: " + getSourceImageOrientationCorrection() + ","); if (getTargetImageOrientationCorrection() != null) sb.append("TargetImageOrientationCorrection: " + getTargetImageOrientationCorrection()); sb.append("}"); return sb.toString(); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getSourceImageFace() == null) ? 0 : getSourceImageFace().hashCode()); hashCode = prime * hashCode + ((getFaceMatches() == null) ? 0 : getFaceMatches().hashCode()); hashCode = prime * hashCode + ((getUnmatchedFaces() == null) ? 0 : getUnmatchedFaces().hashCode()); hashCode = prime * hashCode + ((getSourceImageOrientationCorrection() == null) ? 0 : getSourceImageOrientationCorrection().hashCode()); hashCode = prime * hashCode + ((getTargetImageOrientationCorrection() == null) ? 0 : getTargetImageOrientationCorrection().hashCode()); return hashCode; }
&& other.getFaceMatches().equals(this.getFaceMatches()) == false) return false; if (other.getUnmatchedFaces() == null ^ this.getUnmatchedFaces() == null) return false; if (other.getUnmatchedFaces() != null && other.getUnmatchedFaces().equals(this.getUnmatchedFaces()) == false) return false; if (other.getSourceImageOrientationCorrection() == null