@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getUrls() == null) ? 0 : getUrls().hashCode()); hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getId() == null) ? 0 : getId().hashCode()); hashCode = prime * hashCode + ((getFace() == null) ? 0 : getFace().hashCode()); hashCode = prime * hashCode + ((getMatchConfidence() == null) ? 0 : getMatchConfidence().hashCode()); return hashCode; }
/** * <p> * Provides information about the celebrity's face, such as its location on the image. * </p> * * @param face * Provides information about the celebrity's face, such as its location on the image. * @return Returns a reference to this object so that method calls can be chained together. */ public Celebrity withFace(ComparedFace face) { setFace(face); return this; }
/** * <p> * A unique identifier for the celebrity. * </p> * * @param id * A unique identifier for the celebrity. * @return Returns a reference to this object so that method calls can be chained together. */ public Celebrity withId(String id) { setId(id); return this; }
public Celebrity unmarshall(JsonUnmarshallerContext context) throws Exception { Celebrity celebrity = new Celebrity(); if (context.testExpression("Urls", targetDepth)) { context.nextToken(); celebrity.setUrls(new ListUnmarshaller<String>(context.getUnmarshaller(String.class)).unmarshall(context)); celebrity.setName(context.getUnmarshaller(String.class).unmarshall(context)); celebrity.setId(context.getUnmarshaller(String.class).unmarshall(context)); celebrity.setFace(ComparedFaceJsonUnmarshaller.getInstance().unmarshall(context)); celebrity.setMatchConfidence(context.getUnmarshaller(Float.class).unmarshall(context));
/** * <p> * The name of the celebrity. * </p> * * @param name * The name of the celebrity. * @return Returns a reference to this object so that method calls can be chained together. */ public Celebrity withName(String name) { setName(name); return this; }
/** * <p> * The confidence, in percentage, that Amazon Rekognition has that the recognized face is the celebrity. * </p> * * @param matchConfidence * The confidence, in percentage, that Amazon Rekognition has that the recognized face is the celebrity. * @return Returns a reference to this object so that method calls can be chained together. */ public Celebrity withMatchConfidence(Float matchConfidence) { setMatchConfidence(matchConfidence); return this; }
/** * <p> * An array of URLs pointing to additional information about the celebrity. * If there is no additional information about the celebrity, this list is * empty. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param urls <p> * An array of URLs pointing to additional information about the * celebrity. If there is no additional information about the * celebrity, this list is empty. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public Celebrity withUrls(String... urls) { if (getUrls() == null) { this.urls = new java.util.ArrayList<String>(urls.length); } for (String value : urls) { this.urls.add(value); } return this; }
return null; Celebrity celebrity = new Celebrity(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("Urls")) { celebrity.setUrls(new ListUnmarshaller<String>(StringJsonUnmarshaller.getInstance() celebrity.setName(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("Id")) { celebrity.setId(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("Face")) { celebrity.setFace(ComparedFaceJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("MatchConfidence")) { celebrity.setMatchConfidence(FloatJsonUnmarshaller.getInstance() .unmarshall(context)); } else {
return false; Celebrity other = (Celebrity) obj; if (other.getUrls() == null ^ this.getUrls() == null) return false; if (other.getUrls() != null && other.getUrls().equals(this.getUrls()) == false) return false; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getId() == null ^ this.getId() == null) return false; if (other.getId() != null && other.getId().equals(this.getId()) == false) return false; if (other.getFace() == null ^ this.getFace() == null) return false; if (other.getFace() != null && other.getFace().equals(this.getFace()) == false) return false; if (other.getMatchConfidence() == null ^ this.getMatchConfidence() == null) return false; if (other.getMatchConfidence() != null && other.getMatchConfidence().equals(this.getMatchConfidence()) == 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 (getUrls() != null) sb.append("Urls: ").append(getUrls()).append(","); if (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getId() != null) sb.append("Id: ").append(getId()).append(","); if (getFace() != null) sb.append("Face: ").append(getFace()).append(","); if (getMatchConfidence() != null) sb.append("MatchConfidence: ").append(getMatchConfidence()); sb.append("}"); return sb.toString(); }
/** * Marshall the given parameter object. */ public void marshall(Celebrity celebrity, ProtocolMarshaller protocolMarshaller) { if (celebrity == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(celebrity.getUrls(), URLS_BINDING); protocolMarshaller.marshall(celebrity.getName(), NAME_BINDING); protocolMarshaller.marshall(celebrity.getId(), ID_BINDING); protocolMarshaller.marshall(celebrity.getFace(), FACE_BINDING); protocolMarshaller.marshall(celebrity.getMatchConfidence(), MATCHCONFIDENCE_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 + ((getUrls() == null) ? 0 : getUrls().hashCode()); hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getId() == null) ? 0 : getId().hashCode()); hashCode = prime * hashCode + ((getFace() == null) ? 0 : getFace().hashCode()); hashCode = prime * hashCode + ((getMatchConfidence() == null) ? 0 : getMatchConfidence().hashCode()); return hashCode; }
Celebrity other = (Celebrity) obj; if (other.getUrls() == null ^ this.getUrls() == null) return false; if (other.getUrls() != null && other.getUrls().equals(this.getUrls()) == false) return false; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getId() == null ^ this.getId() == null) return false; if (other.getId() != null && other.getId().equals(this.getId()) == false) return false; if (other.getFace() == null ^ this.getFace() == null) return false; if (other.getFace() != null && other.getFace().equals(this.getFace()) == false) return false; if (other.getMatchConfidence() == null ^ this.getMatchConfidence() == null) return false; if (other.getMatchConfidence() != null && other.getMatchConfidence().equals(this.getMatchConfidence()) == 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 (getUrls() != null) sb.append("Urls: " + getUrls() + ","); if (getName() != null) sb.append("Name: " + getName() + ","); if (getId() != null) sb.append("Id: " + getId() + ","); if (getFace() != null) sb.append("Face: " + getFace() + ","); if (getMatchConfidence() != null) sb.append("MatchConfidence: " + getMatchConfidence()); sb.append("}"); return sb.toString(); }
public void marshall(Celebrity celebrity, AwsJsonWriter jsonWriter) throws Exception { jsonWriter.beginObject(); if (celebrity.getUrls() != null) { java.util.List<String> urls = celebrity.getUrls(); jsonWriter.name("Urls"); jsonWriter.beginArray(); if (celebrity.getName() != null) { String name = celebrity.getName(); jsonWriter.name("Name"); jsonWriter.value(name); if (celebrity.getId() != null) { String id = celebrity.getId(); jsonWriter.name("Id"); jsonWriter.value(id); if (celebrity.getFace() != null) { ComparedFace face = celebrity.getFace(); jsonWriter.name("Face"); ComparedFaceJsonMarshaller.getInstance().marshall(face, jsonWriter); if (celebrity.getMatchConfidence() != null) { Float matchConfidence = celebrity.getMatchConfidence(); jsonWriter.name("MatchConfidence"); jsonWriter.value(matchConfidence);