@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; }
/** * <p> * Level of confidence. * </p> * * @param confidence * Level of confidence. * @return Returns a reference to this object so that method calls can be chained together. */ public Label withConfidence(Float confidence) { setConfidence(confidence); return this; }
/** * <p> * The name (label) of the object or scene. * </p> * * @param name * The name (label) of the object or scene. * @return Returns a reference to this object so that method calls can be chained together. */ public Label withName(String name) { setName(name); return this; }
public Label unmarshall(JsonUnmarshallerContext context) throws Exception { Label label = new Label(); if (context.testExpression("Name", targetDepth)) { context.nextToken(); label.setName(context.getUnmarshaller(String.class).unmarshall(context)); label.setConfidence(context.getUnmarshaller(Float.class).unmarshall(context)); label.setInstances(new ListUnmarshaller<Instance>(InstanceJsonUnmarshaller.getInstance()).unmarshall(context)); label.setParents(new ListUnmarshaller<Parent>(ParentJsonUnmarshaller.getInstance()).unmarshall(context));
@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()); return hashCode; }
public Label unmarshall(JsonUnmarshallerContext context) throws Exception { AwsJsonReader reader = context.getReader(); if (!reader.isContainer()) { reader.skipValue(); return null; } Label label = new Label(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("Name")) { label.setName(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("Confidence")) { label.setConfidence(FloatJsonUnmarshaller.getInstance() .unmarshall(context)); } else { reader.skipValue(); } } reader.endObject(); return label; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getTimestamp() == null) ? 0 : getTimestamp().hashCode()); hashCode = prime * hashCode + ((getLabel() == null) ? 0 : getLabel().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof LabelDetection == false) return false; LabelDetection other = (LabelDetection) obj; if (other.getTimestamp() == null ^ this.getTimestamp() == null) return false; if (other.getTimestamp() != null && other.getTimestamp().equals(this.getTimestamp()) == false) return false; if (other.getLabel() == null ^ this.getLabel() == null) return false; if (other.getLabel() != null && other.getLabel().equals(this.getLabel()) == false) return false; return true; }
/** * <p> * If <code>Label</code> represents an object, <code>Instances</code> contains the bounding boxes for each instance * of the detected object. Bounding boxes are returned for common object labels such as people, cars, furniture, * apparel or pets. * </p> * * @param instances * If <code>Label</code> represents an object, <code>Instances</code> contains the bounding boxes for each * instance of the detected object. Bounding boxes are returned for common object labels such as people, * cars, furniture, apparel or pets. * @return Returns a reference to this object so that method calls can be chained together. */ public Label withInstances(java.util.Collection<Instance> instances) { setInstances(instances); return this; }
@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; } }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getTimestamp() == null) ? 0 : getTimestamp().hashCode()); hashCode = prime * hashCode + ((getLabel() == null) ? 0 : getLabel().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof LabelDetection == false) return false; LabelDetection other = (LabelDetection) obj; if (other.getTimestamp() == null ^ this.getTimestamp() == null) return false; if (other.getTimestamp() != null && other.getTimestamp().equals(this.getTimestamp()) == false) return false; if (other.getLabel() == null ^ this.getLabel() == null) return false; if (other.getLabel() != null && other.getLabel().equals(this.getLabel()) == false) return false; return true; } }
/** * <p> * If <code>Label</code> represents an object, <code>Instances</code> contains the bounding boxes for each instance * of the detected object. Bounding boxes are returned for common object labels such as people, cars, furniture, * apparel or pets. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setInstances(java.util.Collection)} or {@link #withInstances(java.util.Collection)} if you want to * override the existing values. * </p> * * @param instances * If <code>Label</code> represents an object, <code>Instances</code> contains the bounding boxes for each * instance of the detected object. Bounding boxes are returned for common object labels such as people, * cars, furniture, apparel or pets. * @return Returns a reference to this object so that method calls can be chained together. */ public Label withInstances(Instance... instances) { if (this.instances == null) { setInstances(new java.util.ArrayList<Instance>(instances.length)); } for (Instance ele : instances) { this.instances.add(ele); } return this; }
@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; }
/** * 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(); }
/** * 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(); }
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(); }
/** * 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); } }