@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getTimestamp() == null) ? 0 : getTimestamp().hashCode()); hashCode = prime * hashCode + ((getPerson() == null) ? 0 : getPerson().hashCode()); hashCode = prime * hashCode + ((getFaceMatches() == null) ? 0 : getFaceMatches().hashCode()); return hashCode; }
/** * <p> * Information about the faces in the input collection that match the face of a person in the video. * </p> * * @param faceMatches * Information about the faces in the input collection that match the face of a person in the video. * @return Returns a reference to this object so that method calls can be chained together. */ public PersonMatch withFaceMatches(java.util.Collection<FaceMatch> faceMatches) { setFaceMatches(faceMatches); return this; }
/** * <p> * Information about the matched person. * </p> * * @param person * Information about the matched person. * @return Returns a reference to this object so that method calls can be chained together. */ public PersonMatch withPerson(PersonDetail person) { setPerson(person); return this; }
public PersonMatch unmarshall(JsonUnmarshallerContext context) throws Exception { PersonMatch personMatch = new PersonMatch(); if (context.testExpression("Timestamp", targetDepth)) { context.nextToken(); personMatch.setTimestamp(context.getUnmarshaller(Long.class).unmarshall(context)); personMatch.setPerson(PersonDetailJsonUnmarshaller.getInstance().unmarshall(context)); personMatch.setFaceMatches(new ListUnmarshaller<FaceMatch>(FaceMatchJsonUnmarshaller.getInstance()).unmarshall(context));
/** * <p> * The time, in milliseconds from the beginning of the video, that the person was matched in the video. * </p> * * @param timestamp * The time, in milliseconds from the beginning of the video, that the person was matched in the video. * @return Returns a reference to this object so that method calls can be chained together. */ public PersonMatch withTimestamp(Long timestamp) { setTimestamp(timestamp); return this; }
/** * <p> * Information about the faces in the input collection that match the face * of a person in the video. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param faceMatches <p> * Information about the faces in the input collection that match * the face of a person in the video. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public PersonMatch 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; }
public PersonMatch unmarshall(JsonUnmarshallerContext context) throws Exception { AwsJsonReader reader = context.getReader(); if (!reader.isContainer()) { reader.skipValue(); return null; } PersonMatch personMatch = new PersonMatch(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("Timestamp")) { personMatch.setTimestamp(LongJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("Person")) { personMatch.setPerson(PersonDetailJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("FaceMatches")) { personMatch.setFaceMatches(new ListUnmarshaller<FaceMatch>( FaceMatchJsonUnmarshaller.getInstance() ) .unmarshall(context)); } else { reader.skipValue(); } } reader.endObject(); return personMatch; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof PersonMatch == false) return false; PersonMatch other = (PersonMatch) obj; if (other.getTimestamp() == null ^ this.getTimestamp() == null) return false; if (other.getTimestamp() != null && other.getTimestamp().equals(this.getTimestamp()) == false) return false; if (other.getPerson() == null ^ this.getPerson() == null) return false; if (other.getPerson() != null && other.getPerson().equals(this.getPerson()) == false) return false; if (other.getFaceMatches() == null ^ this.getFaceMatches() == null) return false; if (other.getFaceMatches() != null && other.getFaceMatches().equals(this.getFaceMatches()) == false) return false; return true; }
/** * <p> * Information about the faces in the input collection that match the face of a person in the video. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setFaceMatches(java.util.Collection)} or {@link #withFaceMatches(java.util.Collection)} if you want to * override the existing values. * </p> * * @param faceMatches * Information about the faces in the input collection that match the face of a person in the video. * @return Returns a reference to this object so that method calls can be chained together. */ public PersonMatch withFaceMatches(FaceMatch... faceMatches) { if (this.faceMatches == null) { setFaceMatches(new java.util.ArrayList<FaceMatch>(faceMatches.length)); } for (FaceMatch ele : faceMatches) { this.faceMatches.add(ele); } return this; }
/** * 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 (getTimestamp() != null) sb.append("Timestamp: ").append(getTimestamp()).append(","); if (getPerson() != null) sb.append("Person: ").append(getPerson()).append(","); if (getFaceMatches() != null) sb.append("FaceMatches: ").append(getFaceMatches()); sb.append("}"); return sb.toString(); }
/** * <p> * Information about the faces in the input collection that match the face * of a person in the video. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param faceMatches <p> * Information about the faces in the input collection that match * the face of a person in the video. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public PersonMatch withFaceMatches(java.util.Collection<FaceMatch> faceMatches) { setFaceMatches(faceMatches); return this; }
/** * Marshall the given parameter object. */ public void marshall(PersonMatch personMatch, ProtocolMarshaller protocolMarshaller) { if (personMatch == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(personMatch.getTimestamp(), TIMESTAMP_BINDING); protocolMarshaller.marshall(personMatch.getPerson(), PERSON_BINDING); protocolMarshaller.marshall(personMatch.getFaceMatches(), FACEMATCHES_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 + ((getTimestamp() == null) ? 0 : getTimestamp().hashCode()); hashCode = prime * hashCode + ((getPerson() == null) ? 0 : getPerson().hashCode()); hashCode = prime * hashCode + ((getFaceMatches() == null) ? 0 : getFaceMatches().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof PersonMatch == false) return false; PersonMatch other = (PersonMatch) obj; if (other.getTimestamp() == null ^ this.getTimestamp() == null) return false; if (other.getTimestamp() != null && other.getTimestamp().equals(this.getTimestamp()) == false) return false; if (other.getPerson() == null ^ this.getPerson() == null) return false; if (other.getPerson() != null && other.getPerson().equals(this.getPerson()) == false) return false; if (other.getFaceMatches() == null ^ this.getFaceMatches() == null) return false; if (other.getFaceMatches() != null && other.getFaceMatches().equals(this.getFaceMatches()) == 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 (getTimestamp() != null) sb.append("Timestamp: " + getTimestamp() + ","); if (getPerson() != null) sb.append("Person: " + getPerson() + ","); if (getFaceMatches() != null) sb.append("FaceMatches: " + getFaceMatches()); sb.append("}"); return sb.toString(); }
public void marshall(PersonMatch personMatch, AwsJsonWriter jsonWriter) throws Exception { jsonWriter.beginObject(); if (personMatch.getTimestamp() != null) { Long timestamp = personMatch.getTimestamp(); jsonWriter.name("Timestamp"); jsonWriter.value(timestamp); } if (personMatch.getPerson() != null) { PersonDetail person = personMatch.getPerson(); jsonWriter.name("Person"); PersonDetailJsonMarshaller.getInstance().marshall(person, jsonWriter); } if (personMatch.getFaceMatches() != null) { java.util.List<FaceMatch> faceMatches = personMatch.getFaceMatches(); jsonWriter.name("FaceMatches"); jsonWriter.beginArray(); for (FaceMatch faceMatchesItem : faceMatches) { if (faceMatchesItem != null) { FaceMatchJsonMarshaller.getInstance().marshall(faceMatchesItem, jsonWriter); } } jsonWriter.endArray(); } jsonWriter.endObject(); }