/** * 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 (getImage() != null) sb.append("Image: ").append(getImage()).append(","); if (getMaxLabels() != null) sb.append("MaxLabels: ").append(getMaxLabels()).append(","); if (getMinConfidence() != null) sb.append("MinConfidence: ").append(getMinConfidence()); sb.append("}"); return sb.toString(); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getImage() == null) ? 0 : getImage().hashCode()); hashCode = prime * hashCode + ((getMaxLabels() == null) ? 0 : getMaxLabels().hashCode()); hashCode = prime * hashCode + ((getMinConfidence() == null) ? 0 : getMinConfidence().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DetectLabelsRequest == false) return false; DetectLabelsRequest other = (DetectLabelsRequest) obj; if (other.getImage() == null ^ this.getImage() == null) return false; if (other.getImage() != null && other.getImage().equals(this.getImage()) == false) return false; if (other.getMaxLabels() == null ^ this.getMaxLabels() == null) return false; if (other.getMaxLabels() != null && other.getMaxLabels().equals(this.getMaxLabels()) == false) return false; if (other.getMinConfidence() == null ^ this.getMinConfidence() == null) return false; if (other.getMinConfidence() != null && other.getMinConfidence().equals(this.getMinConfidence()) == false) return false; return true; }
/** * Marshall the given parameter object. */ public void marshall(DetectLabelsRequest detectLabelsRequest, ProtocolMarshaller protocolMarshaller) { if (detectLabelsRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(detectLabelsRequest.getImage(), IMAGE_BINDING); protocolMarshaller.marshall(detectLabelsRequest.getMaxLabels(), MAXLABELS_BINDING); protocolMarshaller.marshall(detectLabelsRequest.getMinConfidence(), MINCONFIDENCE_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 + ((getImage() == null) ? 0 : getImage().hashCode()); hashCode = prime * hashCode + ((getMaxLabels() == null) ? 0 : getMaxLabels().hashCode()); hashCode = prime * hashCode + ((getMinConfidence() == null) ? 0 : getMinConfidence().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 (getImage() != null) sb.append("Image: " + getImage() + ","); if (getMaxLabels() != null) sb.append("MaxLabels: " + getMaxLabels() + ","); if (getMinConfidence() != null) sb.append("MinConfidence: " + getMinConfidence()); sb.append("}"); return sb.toString(); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DetectLabelsRequest == false) return false; DetectLabelsRequest other = (DetectLabelsRequest) obj; if (other.getImage() == null ^ this.getImage() == null) return false; if (other.getImage() != null && other.getImage().equals(this.getImage()) == false) return false; if (other.getMaxLabels() == null ^ this.getMaxLabels() == null) return false; if (other.getMaxLabels() != null && other.getMaxLabels().equals(this.getMaxLabels()) == false) return false; if (other.getMinConfidence() == null ^ this.getMinConfidence() == null) return false; if (other.getMinConfidence() != null && other.getMinConfidence().equals(this.getMinConfidence()) == false) return false; return true; } }
ImageJsonMarshaller.getInstance().marshall(image, jsonWriter); if (detectLabelsRequest.getMaxLabels() != null) { Integer maxLabels = detectLabelsRequest.getMaxLabels(); jsonWriter.name("MaxLabels"); jsonWriter.value(maxLabels);