@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getConfidence() == null) ? 0 : getConfidence().hashCode()); hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getParentName() == null) ? 0 : getParentName().hashCode()); return hashCode; }
/** * <p> * Specifies the confidence that Amazon Rekognition has that the label has been correctly identified. * </p> * <p> * If you don't specify the <code>MinConfidence</code> parameter in the call to <code>DetectModerationLabels</code>, * the operation returns labels with a confidence value greater than or equal to 50 percent. * </p> * * @param confidence * Specifies the confidence that Amazon Rekognition has that the label has been correctly identified.</p> * <p> * If you don't specify the <code>MinConfidence</code> parameter in the call to * <code>DetectModerationLabels</code>, the operation returns labels with a confidence value greater than or * equal to 50 percent. * @return Returns a reference to this object so that method calls can be chained together. */ public ModerationLabel withConfidence(Float confidence) { setConfidence(confidence); return this; }
/** * <p> * The label name for the type of content detected in the image. * </p> * * @param name * The label name for the type of content detected in the image. * @return Returns a reference to this object so that method calls can be chained together. */ public ModerationLabel withName(String name) { setName(name); return this; }
public ModerationLabel unmarshall(JsonUnmarshallerContext context) throws Exception { ModerationLabel moderationLabel = new ModerationLabel(); if (context.testExpression("Confidence", targetDepth)) { context.nextToken(); moderationLabel.setConfidence(context.getUnmarshaller(Float.class).unmarshall(context)); moderationLabel.setName(context.getUnmarshaller(String.class).unmarshall(context)); moderationLabel.setParentName(context.getUnmarshaller(String.class).unmarshall(context));
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getTimestamp() == null) ? 0 : getTimestamp().hashCode()); hashCode = prime * hashCode + ((getModerationLabel() == null) ? 0 : getModerationLabel().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ContentModerationDetection == false) return false; ContentModerationDetection other = (ContentModerationDetection) obj; if (other.getTimestamp() == null ^ this.getTimestamp() == null) return false; if (other.getTimestamp() != null && other.getTimestamp().equals(this.getTimestamp()) == false) return false; if (other.getModerationLabel() == null ^ this.getModerationLabel() == null) return false; if (other.getModerationLabel() != null && other.getModerationLabel().equals(this.getModerationLabel()) == false) return false; return true; }
/** * <p> * The name for the parent label. Labels at the top level of the hierarchy have the parent label <code>""</code>. * </p> * * @param parentName * The name for the parent label. Labels at the top level of the hierarchy have the parent label * <code>""</code>. * @return Returns a reference to this object so that method calls can be chained together. */ public ModerationLabel withParentName(String parentName) { setParentName(parentName); return this; }
public ModerationLabel unmarshall(JsonUnmarshallerContext context) throws Exception { AwsJsonReader reader = context.getReader(); if (!reader.isContainer()) { reader.skipValue(); return null; } ModerationLabel moderationLabel = new ModerationLabel(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("Confidence")) { moderationLabel.setConfidence(FloatJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("Name")) { moderationLabel.setName(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("ParentName")) { moderationLabel.setParentName(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else { reader.skipValue(); } } reader.endObject(); return moderationLabel; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getTimestamp() == null) ? 0 : getTimestamp().hashCode()); hashCode = prime * hashCode + ((getModerationLabel() == null) ? 0 : getModerationLabel().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ContentModerationDetection == false) return false; ContentModerationDetection other = (ContentModerationDetection) obj; if (other.getTimestamp() == null ^ this.getTimestamp() == null) return false; if (other.getTimestamp() != null && other.getTimestamp().equals(this.getTimestamp()) == false) return false; if (other.getModerationLabel() == null ^ this.getModerationLabel() == null) return false; if (other.getModerationLabel() != null && other.getModerationLabel().equals(this.getModerationLabel()) == false) return false; return true; } }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ModerationLabel == false) return false; ModerationLabel other = (ModerationLabel) obj; if (other.getConfidence() == null ^ this.getConfidence() == null) return false; if (other.getConfidence() != null && other.getConfidence().equals(this.getConfidence()) == 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.getParentName() == null ^ this.getParentName() == null) return false; if (other.getParentName() != null && other.getParentName().equals(this.getParentName()) == 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 (getConfidence() != null) sb.append("Confidence: ").append(getConfidence()).append(","); if (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getParentName() != null) sb.append("ParentName: ").append(getParentName()); sb.append("}"); return sb.toString(); }
/** * Marshall the given parameter object. */ public void marshall(ModerationLabel moderationLabel, ProtocolMarshaller protocolMarshaller) { if (moderationLabel == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(moderationLabel.getConfidence(), CONFIDENCE_BINDING); protocolMarshaller.marshall(moderationLabel.getName(), NAME_BINDING); protocolMarshaller.marshall(moderationLabel.getParentName(), PARENTNAME_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 + ((getConfidence() == null) ? 0 : getConfidence().hashCode()); hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getParentName() == null) ? 0 : getParentName().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ModerationLabel == false) return false; ModerationLabel other = (ModerationLabel) obj; if (other.getConfidence() == null ^ this.getConfidence() == null) return false; if (other.getConfidence() != null && other.getConfidence().equals(this.getConfidence()) == 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.getParentName() == null ^ this.getParentName() == null) return false; if (other.getParentName() != null && other.getParentName().equals(this.getParentName()) == 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 (getConfidence() != null) sb.append("Confidence: " + getConfidence() + ","); if (getName() != null) sb.append("Name: " + getName() + ","); if (getParentName() != null) sb.append("ParentName: " + getParentName()); sb.append("}"); return sb.toString(); }
public void marshall(ModerationLabel moderationLabel, AwsJsonWriter jsonWriter) throws Exception { jsonWriter.beginObject(); if (moderationLabel.getConfidence() != null) { Float confidence = moderationLabel.getConfidence(); jsonWriter.name("Confidence"); jsonWriter.value(confidence); } if (moderationLabel.getName() != null) { String name = moderationLabel.getName(); jsonWriter.name("Name"); jsonWriter.value(name); } if (moderationLabel.getParentName() != null) { String parentName = moderationLabel.getParentName(); jsonWriter.name("ParentName"); jsonWriter.value(parentName); } jsonWriter.endObject(); }