@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode()); hashCode = prime * hashCode + ((getConfidence() == null) ? 0 : getConfidence().hashCode()); return hashCode; }
/** * <p> * Level of confidence in the determination. * </p> * * @param confidence * Level of confidence in the determination. * @return Returns a reference to this object so that method calls can be chained together. */ public Emotion withConfidence(Float confidence) { setConfidence(confidence); return this; }
/** * <p> * Type of emotion detected. * </p> * * @param type * Type of emotion detected. * @return Returns a reference to this object so that method calls can be chained together. * @see EmotionName */ public Emotion withType(String type) { setType(type); return this; }
public Emotion unmarshall(JsonUnmarshallerContext context) throws Exception { Emotion emotion = new Emotion(); if (context.testExpression("Type", targetDepth)) { context.nextToken(); emotion.setType(context.getUnmarshaller(String.class).unmarshall(context)); emotion.setConfidence(context.getUnmarshaller(Float.class).unmarshall(context));
/** * <p> * Type of emotion detected. * </p> * * @param type * Type of emotion detected. * @see EmotionName */ public void setType(EmotionName type) { withType(type); }
public Emotion unmarshall(JsonUnmarshallerContext context) throws Exception { AwsJsonReader reader = context.getReader(); if (!reader.isContainer()) { reader.skipValue(); return null; } Emotion emotion = new Emotion(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("Type")) { emotion.setType(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("Confidence")) { emotion.setConfidence(FloatJsonUnmarshaller.getInstance() .unmarshall(context)); } else { reader.skipValue(); } } reader.endObject(); return emotion; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Emotion == false) return false; Emotion other = (Emotion) obj; if (other.getType() == null ^ this.getType() == null) return false; if (other.getType() != null && other.getType().equals(this.getType()) == 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; }
/** * 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 (getType() != null) sb.append("Type: ").append(getType()).append(","); if (getConfidence() != null) sb.append("Confidence: ").append(getConfidence()); sb.append("}"); return sb.toString(); }
/** * Marshall the given parameter object. */ public void marshall(Emotion emotion, ProtocolMarshaller protocolMarshaller) { if (emotion == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(emotion.getType(), TYPE_BINDING); protocolMarshaller.marshall(emotion.getConfidence(), CONFIDENCE_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 + ((getType() == null) ? 0 : getType().hashCode()); hashCode = prime * hashCode + ((getConfidence() == null) ? 0 : getConfidence().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Emotion == false) return false; Emotion other = (Emotion) obj; if (other.getType() == null ^ this.getType() == null) return false; if (other.getType() != null && other.getType().equals(this.getType()) == 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; } }
/** * 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 (getType() != null) sb.append("Type: " + getType() + ","); if (getConfidence() != null) sb.append("Confidence: " + getConfidence()); sb.append("}"); return sb.toString(); }
public void marshall(Emotion emotion, AwsJsonWriter jsonWriter) throws Exception { jsonWriter.beginObject(); if (emotion.getType() != null) { String type = emotion.getType(); jsonWriter.name("Type"); jsonWriter.value(type); } if (emotion.getConfidence() != null) { Float confidence = emotion.getConfidence(); jsonWriter.name("Confidence"); jsonWriter.value(confidence); } jsonWriter.endObject(); }