@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getConfidence() == null) ? 0 : getConfidence().hashCode()); hashCode = prime * hashCode + ((getInstances() == null) ? 0 : getInstances().hashCode()); hashCode = prime * hashCode + ((getParents() == null) ? 0 : getParents().hashCode()); return hashCode; }
/** * 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 (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getConfidence() != null) sb.append("Confidence: ").append(getConfidence()).append(","); if (getInstances() != null) sb.append("Instances: ").append(getInstances()).append(","); if (getParents() != null) sb.append("Parents: ").append(getParents()); sb.append("}"); return sb.toString(); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Label == false) return false; Label other = (Label) obj; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getConfidence() == null ^ this.getConfidence() == null) return false; if (other.getConfidence() != null && other.getConfidence().equals(this.getConfidence()) == false) return false; if (other.getInstances() == null ^ this.getInstances() == null) return false; if (other.getInstances() != null && other.getInstances().equals(this.getInstances()) == false) return false; if (other.getParents() == null ^ this.getParents() == null) return false; if (other.getParents() != null && other.getParents().equals(this.getParents()) == false) return false; return true; }
/** * Marshall the given parameter object. */ public void marshall(Label label, ProtocolMarshaller protocolMarshaller) { if (label == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(label.getName(), NAME_BINDING); protocolMarshaller.marshall(label.getConfidence(), CONFIDENCE_BINDING); protocolMarshaller.marshall(label.getInstances(), INSTANCES_BINDING); protocolMarshaller.marshall(label.getParents(), PARENTS_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
/** * 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 (getName() != null) sb.append("Name: " + getName() + ","); if (getConfidence() != null) sb.append("Confidence: " + getConfidence()); sb.append("}"); return sb.toString(); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Label == false) return false; Label other = (Label) obj; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getConfidence() == null ^ this.getConfidence() == null) return false; if (other.getConfidence() != null && other.getConfidence().equals(this.getConfidence()) == false) return false; return true; } }
public void marshall(Label label, AwsJsonWriter jsonWriter) throws Exception { jsonWriter.beginObject(); if (label.getName() != null) { String name = label.getName(); jsonWriter.name("Name"); jsonWriter.value(name); } if (label.getConfidence() != null) { Float confidence = label.getConfidence(); jsonWriter.name("Confidence"); jsonWriter.value(confidence); } jsonWriter.endObject(); }