@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getCollectionId() == null) ? 0 : getCollectionId().hashCode()); hashCode = prime * hashCode + ((getFaceId() == null) ? 0 : getFaceId().hashCode()); hashCode = prime * hashCode + ((getMaxFaces() == null) ? 0 : getMaxFaces().hashCode()); hashCode = prime * hashCode + ((getFaceMatchThreshold() == null) ? 0 : getFaceMatchThreshold().hashCode()); return hashCode; }
/** * <p> * ID of the collection the face belongs to. * </p> * * @param collectionId * ID of the collection the face belongs to. * @return Returns a reference to this object so that method calls can be chained together. */ public SearchFacesRequest withCollectionId(String collectionId) { setCollectionId(collectionId); return this; }
/** * <p> * ID of a face to find matches for in the collection. * </p> * * @param faceId * ID of a face to find matches for in the collection. * @return Returns a reference to this object so that method calls can be chained together. */ public SearchFacesRequest withFaceId(String faceId) { setFaceId(faceId); return this; }
/** * Constructs a new SearchFacesRequest object. Callers should use the setter * or fluent setter (with...) methods to initialize any additional object * members. * * @param collectionId <p> * ID of the collection the face belongs to. * </p> * @param faceId <p> * ID of a face to find matches for in the collection. * </p> */ public SearchFacesRequest(String collectionId, String faceId) { setCollectionId(collectionId); setFaceId(faceId); }
/** * <p> * Maximum number of faces to return. The operation returns the maximum number of faces with the highest confidence * in the match. * </p> * * @param maxFaces * Maximum number of faces to return. The operation returns the maximum number of faces with the highest * confidence in the match. * @return Returns a reference to this object so that method calls can be chained together. */ public SearchFacesRequest withMaxFaces(Integer maxFaces) { setMaxFaces(maxFaces); return this; }
/** * <p> * Optional value specifying the minimum confidence in the face match to return. For example, don't return any * matches where confidence in matches is less than 70%. * </p> * * @param faceMatchThreshold * Optional value specifying the minimum confidence in the face match to return. For example, don't return * any matches where confidence in matches is less than 70%. * @return Returns a reference to this object so that method calls can be chained together. */ public SearchFacesRequest withFaceMatchThreshold(Float faceMatchThreshold) { setFaceMatchThreshold(faceMatchThreshold); return this; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof SearchFacesRequest == false) return false; SearchFacesRequest other = (SearchFacesRequest) obj; if (other.getCollectionId() == null ^ this.getCollectionId() == null) return false; if (other.getCollectionId() != null && other.getCollectionId().equals(this.getCollectionId()) == false) return false; if (other.getFaceId() == null ^ this.getFaceId() == null) return false; if (other.getFaceId() != null && other.getFaceId().equals(this.getFaceId()) == false) return false; if (other.getMaxFaces() == null ^ this.getMaxFaces() == null) return false; if (other.getMaxFaces() != null && other.getMaxFaces().equals(this.getMaxFaces()) == false) return false; if (other.getFaceMatchThreshold() == null ^ this.getFaceMatchThreshold() == null) return false; if (other.getFaceMatchThreshold() != null && other.getFaceMatchThreshold().equals(this.getFaceMatchThreshold()) == false) return false; return true; }
/** * 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 (getCollectionId() != null) sb.append("CollectionId: ").append(getCollectionId()).append(","); if (getFaceId() != null) sb.append("FaceId: ").append(getFaceId()).append(","); if (getMaxFaces() != null) sb.append("MaxFaces: ").append(getMaxFaces()).append(","); if (getFaceMatchThreshold() != null) sb.append("FaceMatchThreshold: ").append(getFaceMatchThreshold()); sb.append("}"); return sb.toString(); }
/** * Marshall the given parameter object. */ public void marshall(SearchFacesRequest searchFacesRequest, ProtocolMarshaller protocolMarshaller) { if (searchFacesRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(searchFacesRequest.getCollectionId(), COLLECTIONID_BINDING); protocolMarshaller.marshall(searchFacesRequest.getFaceId(), FACEID_BINDING); protocolMarshaller.marshall(searchFacesRequest.getMaxFaces(), MAXFACES_BINDING); protocolMarshaller.marshall(searchFacesRequest.getFaceMatchThreshold(), FACEMATCHTHRESHOLD_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getCollectionId() == null) ? 0 : getCollectionId().hashCode()); hashCode = prime * hashCode + ((getFaceId() == null) ? 0 : getFaceId().hashCode()); hashCode = prime * hashCode + ((getMaxFaces() == null) ? 0 : getMaxFaces().hashCode()); hashCode = prime * hashCode + ((getFaceMatchThreshold() == null) ? 0 : getFaceMatchThreshold().hashCode()); return hashCode; }
SearchFacesRequest other = (SearchFacesRequest) obj; if (other.getCollectionId() == null ^ this.getCollectionId() == null) return false; if (other.getCollectionId() != null && other.getCollectionId().equals(this.getCollectionId()) == false) return false; if (other.getFaceId() == null ^ this.getFaceId() == null) return false; if (other.getFaceId() != null && other.getFaceId().equals(this.getFaceId()) == false) return false; if (other.getMaxFaces() == null ^ this.getMaxFaces() == null) return false; if (other.getMaxFaces() != null && other.getMaxFaces().equals(this.getMaxFaces()) == false) return false; if (other.getFaceMatchThreshold() == null ^ this.getFaceMatchThreshold() == null) return false; if (other.getFaceMatchThreshold() != null && other.getFaceMatchThreshold().equals(this.getFaceMatchThreshold()) == false) return false; return true;
/** * 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 (getCollectionId() != null) sb.append("CollectionId: " + getCollectionId() + ","); if (getFaceId() != null) sb.append("FaceId: " + getFaceId() + ","); if (getMaxFaces() != null) sb.append("MaxFaces: " + getMaxFaces() + ","); if (getFaceMatchThreshold() != null) sb.append("FaceMatchThreshold: " + getFaceMatchThreshold()); sb.append("}"); return sb.toString(); }
jsonWriter.beginObject(); if (searchFacesRequest.getCollectionId() != null) { String collectionId = searchFacesRequest.getCollectionId(); jsonWriter.name("CollectionId"); jsonWriter.value(collectionId); if (searchFacesRequest.getFaceId() != null) { String faceId = searchFacesRequest.getFaceId(); jsonWriter.name("FaceId"); jsonWriter.value(faceId); if (searchFacesRequest.getMaxFaces() != null) { Integer maxFaces = searchFacesRequest.getMaxFaces(); jsonWriter.name("MaxFaces"); jsonWriter.value(maxFaces); if (searchFacesRequest.getFaceMatchThreshold() != null) { Float faceMatchThreshold = searchFacesRequest.getFaceMatchThreshold(); jsonWriter.name("FaceMatchThreshold"); jsonWriter.value(faceMatchThreshold);