/** * <p> * Within the bounding box, a fine-grained polygon around the detected text. * </p> * * @param polygon * Within the bounding box, a fine-grained polygon around the detected text. * @return Returns a reference to this object so that method calls can be chained together. */ public Geometry withPolygon(java.util.Collection<Point> polygon) { setPolygon(polygon); return this; }
/** * <p> * Within the bounding box, a fine-grained polygon around the detected text. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setPolygon(java.util.Collection)} or {@link #withPolygon(java.util.Collection)} if you want to override * the existing values. * </p> * * @param polygon * Within the bounding box, a fine-grained polygon around the detected text. * @return Returns a reference to this object so that method calls can be chained together. */ public Geometry withPolygon(Point... polygon) { if (this.polygon == null) { setPolygon(new java.util.ArrayList<Point>(polygon.length)); } for (Point ele : polygon) { this.polygon.add(ele); } return this; }
geometry.setPolygon(new ListUnmarshaller<Point>(PointJsonUnmarshaller.getInstance()).unmarshall(context));
/** * <p> * Within the bounding box, a fine-grained polygon around the detected text. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param polygon <p> * Within the bounding box, a fine-grained polygon around the * detected text. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public Geometry withPolygon(java.util.Collection<Point> polygon) { setPolygon(polygon); return this; }
public Geometry unmarshall(JsonUnmarshallerContext context) throws Exception { AwsJsonReader reader = context.getReader(); if (!reader.isContainer()) { reader.skipValue(); return null; } Geometry geometry = new Geometry(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("BoundingBox")) { geometry.setBoundingBox(BoundingBoxJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("Polygon")) { geometry.setPolygon(new ListUnmarshaller<Point>(PointJsonUnmarshaller.getInstance() ) .unmarshall(context)); } else { reader.skipValue(); } } reader.endObject(); return geometry; }