/** * 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(); }
@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; }
/** * 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 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; }
@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; }
/** * 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(); }
@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; } }
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(); }