@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; }
/** * <p> * The confidence that Amazon Rekognition has in the accuracy of the detected text and the accuracy of the geometry * points around the detected text. * </p> * * @param confidence * The confidence that Amazon Rekognition has in the accuracy of the detected text and the accuracy of the * geometry points around the detected text. * @return Returns a reference to this object so that method calls can be chained together. */ public TextDetection withConfidence(Float confidence) { setConfidence(confidence); return this; }
/** * <p> * The word or line of text recognized by Amazon Rekognition. * </p> * * @param detectedText * The word or line of text recognized by Amazon Rekognition. * @return Returns a reference to this object so that method calls can be chained together. */ public TextDetection withDetectedText(String detectedText) { setDetectedText(detectedText); return this; }
public TextDetection unmarshall(JsonUnmarshallerContext context) throws Exception { TextDetection textDetection = new TextDetection(); if (context.testExpression("DetectedText", targetDepth)) { context.nextToken(); textDetection.setDetectedText(context.getUnmarshaller(String.class).unmarshall(context)); textDetection.setType(context.getUnmarshaller(String.class).unmarshall(context)); textDetection.setId(context.getUnmarshaller(Integer.class).unmarshall(context)); textDetection.setParentId(context.getUnmarshaller(Integer.class).unmarshall(context)); textDetection.setConfidence(context.getUnmarshaller(Float.class).unmarshall(context)); textDetection.setGeometry(GeometryJsonUnmarshaller.getInstance().unmarshall(context));
/** * <p> * The location of the detected text on the image. Includes an axis aligned coarse bounding box surrounding the text * and a finer grain polygon for more accurate spatial information. * </p> * * @param geometry * The location of the detected text on the image. Includes an axis aligned coarse bounding box surrounding * the text and a finer grain polygon for more accurate spatial information. * @return Returns a reference to this object so that method calls can be chained together. */ public TextDetection withGeometry(Geometry geometry) { setGeometry(geometry); return this; }
return null; TextDetection textDetection = new TextDetection(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("DetectedText")) { textDetection.setDetectedText(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("Type")) { textDetection.setType(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("Id")) { textDetection.setId(IntegerJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("ParentId")) { textDetection.setParentId(IntegerJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("Confidence")) { textDetection.setConfidence(FloatJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("Geometry")) { textDetection.setGeometry(GeometryJsonUnmarshaller.getInstance() .unmarshall(context)); } else {
return false; TextDetection other = (TextDetection) obj; if (other.getDetectedText() == null ^ this.getDetectedText() == null) return false; if (other.getDetectedText() != null && other.getDetectedText().equals(this.getDetectedText()) == false) return false; if (other.getType() == null ^ this.getType() == null) return false; if (other.getType() != null && other.getType().equals(this.getType()) == false) return false; if (other.getId() == null ^ this.getId() == null) return false; if (other.getId() != null && other.getId().equals(this.getId()) == false) return false; if (other.getParentId() == null ^ this.getParentId() == null) return false; 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) return false; if (other.getGeometry() != null && other.getGeometry().equals(this.getGeometry()) == 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 (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(); }
/** * 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); } }
@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; }
/** * 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(); }
if (other.getDetectedText() == null ^ this.getDetectedText() == null) return false; if (other.getDetectedText() != null && other.getDetectedText().equals(this.getDetectedText()) == false) return false; if (other.getType() == null ^ this.getType() == null) return false; if (other.getType() != null && other.getType().equals(this.getType()) == false) return false; if (other.getId() == null ^ this.getId() == null) return false; if (other.getId() != null && other.getId().equals(this.getId()) == false) return false; if (other.getParentId() == null ^ this.getParentId() == null) return false; 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) return false; if (other.getGeometry() != null && other.getGeometry().equals(this.getGeometry()) == false) return false; return true;
public void marshall(TextDetection textDetection, AwsJsonWriter jsonWriter) throws Exception { jsonWriter.beginObject(); if (textDetection.getDetectedText() != null) { String detectedText = textDetection.getDetectedText(); jsonWriter.name("DetectedText"); jsonWriter.value(detectedText); if (textDetection.getType() != null) { String type = textDetection.getType(); jsonWriter.name("Type"); jsonWriter.value(type); if (textDetection.getId() != null) { Integer id = textDetection.getId(); jsonWriter.name("Id"); jsonWriter.value(id); if (textDetection.getParentId() != null) { Integer parentId = textDetection.getParentId(); jsonWriter.name("ParentId"); jsonWriter.value(parentId); if (textDetection.getConfidence() != null) { Float confidence = textDetection.getConfidence(); jsonWriter.name("Confidence"); jsonWriter.value(confidence); if (textDetection.getGeometry() != null) { Geometry geometry = textDetection.getGeometry(); jsonWriter.name("Geometry");