/** * 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 (getDetectedText() != null) sb.append("DetectedText: ").append(getDetectedText()).append(","); if (getType() != null) sb.append("Type: ").append(getType()).append(","); if (getId() != null) sb.append("Id: ").append(getId()).append(","); if (getParentId() != null) sb.append("ParentId: ").append(getParentId()).append(","); if (getConfidence() != null) sb.append("Confidence: ").append(getConfidence()).append(","); if (getGeometry() != null) sb.append("Geometry: ").append(getGeometry()); sb.append("}"); return sb.toString(); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getDetectedText() == null) ? 0 : getDetectedText().hashCode()); hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode()); hashCode = prime * hashCode + ((getId() == null) ? 0 : getId().hashCode()); hashCode = prime * hashCode + ((getParentId() == null) ? 0 : getParentId().hashCode()); hashCode = prime * hashCode + ((getConfidence() == null) ? 0 : getConfidence().hashCode()); hashCode = prime * hashCode + ((getGeometry() == null) ? 0 : getGeometry().hashCode()); return hashCode; }
if (other.getParentId() != null && other.getParentId().equals(this.getParentId()) == 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.getGeometry() == null ^ this.getGeometry() == null)
/** * Marshall the given parameter object. */ public void marshall(TextDetection textDetection, ProtocolMarshaller protocolMarshaller) { if (textDetection == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(textDetection.getDetectedText(), DETECTEDTEXT_BINDING); protocolMarshaller.marshall(textDetection.getType(), TYPE_BINDING); protocolMarshaller.marshall(textDetection.getId(), ID_BINDING); protocolMarshaller.marshall(textDetection.getParentId(), PARENTID_BINDING); protocolMarshaller.marshall(textDetection.getConfidence(), CONFIDENCE_BINDING); protocolMarshaller.marshall(textDetection.getGeometry(), GEOMETRY_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 (getDetectedText() != null) sb.append("DetectedText: " + getDetectedText() + ","); if (getType() != null) sb.append("Type: " + getType() + ","); if (getId() != null) sb.append("Id: " + getId() + ","); if (getParentId() != null) sb.append("ParentId: " + getParentId() + ","); if (getConfidence() != null) sb.append("Confidence: " + getConfidence() + ","); if (getGeometry() != null) sb.append("Geometry: " + getGeometry()); sb.append("}"); return sb.toString(); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getDetectedText() == null) ? 0 : getDetectedText().hashCode()); hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode()); hashCode = prime * hashCode + ((getId() == null) ? 0 : getId().hashCode()); hashCode = prime * hashCode + ((getParentId() == null) ? 0 : getParentId().hashCode()); hashCode = prime * hashCode + ((getConfidence() == null) ? 0 : getConfidence().hashCode()); hashCode = prime * hashCode + ((getGeometry() == null) ? 0 : getGeometry().hashCode()); return hashCode; }
if (other.getParentId() != null && other.getParentId().equals(this.getParentId()) == 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.getGeometry() == null ^ this.getGeometry() == null)
jsonWriter.value(parentId); if (textDetection.getConfidence() != null) { Float confidence = textDetection.getConfidence(); jsonWriter.name("Confidence"); jsonWriter.value(confidence);