@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getBoundingBox() == null) ? 0 : getBoundingBox().hashCode()); hashCode = prime * hashCode + ((getPolygon() == null) ? 0 : getPolygon().hashCode()); return hashCode; }
/** * 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 (getBoundingBox() != null) sb.append("BoundingBox: ").append(getBoundingBox()).append(","); if (getPolygon() != null) sb.append("Polygon: ").append(getPolygon()); sb.append("}"); return sb.toString(); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Geometry == false) return false; Geometry other = (Geometry) obj; if (other.getBoundingBox() == null ^ this.getBoundingBox() == null) return false; if (other.getBoundingBox() != null && other.getBoundingBox().equals(this.getBoundingBox()) == false) return false; if (other.getPolygon() == null ^ this.getPolygon() == null) return false; if (other.getPolygon() != null && other.getPolygon().equals(this.getPolygon()) == false) return false; return true; }
/** * Marshall the given parameter object. */ public void marshall(Geometry geometry, ProtocolMarshaller protocolMarshaller) { if (geometry == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(geometry.getBoundingBox(), BOUNDINGBOX_BINDING); protocolMarshaller.marshall(geometry.getPolygon(), POLYGON_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 (getBoundingBox() != null) sb.append("BoundingBox: " + getBoundingBox() + ","); if (getPolygon() != null) sb.append("Polygon: " + getPolygon()); sb.append("}"); return sb.toString(); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getBoundingBox() == null) ? 0 : getBoundingBox().hashCode()); hashCode = prime * hashCode + ((getPolygon() == null) ? 0 : getPolygon().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Geometry == false) return false; Geometry other = (Geometry) obj; if (other.getBoundingBox() == null ^ this.getBoundingBox() == null) return false; if (other.getBoundingBox() != null && other.getBoundingBox().equals(this.getBoundingBox()) == false) return false; if (other.getPolygon() == null ^ this.getPolygon() == null) return false; if (other.getPolygon() != null && other.getPolygon().equals(this.getPolygon()) == false) return false; return true; } }
public void marshall(Geometry geometry, AwsJsonWriter jsonWriter) throws Exception { jsonWriter.beginObject(); if (geometry.getBoundingBox() != null) { BoundingBox boundingBox = geometry.getBoundingBox(); jsonWriter.name("BoundingBox"); BoundingBoxJsonMarshaller.getInstance().marshall(boundingBox, jsonWriter); } if (geometry.getPolygon() != null) { java.util.List<Point> polygon = geometry.getPolygon(); jsonWriter.name("Polygon"); jsonWriter.beginArray(); for (Point polygonItem : polygon) { if (polygonItem != null) { PointJsonMarshaller.getInstance().marshall(polygonItem, jsonWriter); } } jsonWriter.endArray(); } jsonWriter.endObject(); }