@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getWidth() == null) ? 0 : getWidth().hashCode()); hashCode = prime * hashCode + ((getHeight() == null) ? 0 : getHeight().hashCode()); hashCode = prime * hashCode + ((getLeft() == null) ? 0 : getLeft().hashCode()); hashCode = prime * hashCode + ((getTop() == null) ? 0 : getTop().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 (getWidth() != null) sb.append("Width: ").append(getWidth()).append(","); if (getHeight() != null) sb.append("Height: ").append(getHeight()).append(","); if (getLeft() != null) sb.append("Left: ").append(getLeft()).append(","); if (getTop() != null) sb.append("Top: ").append(getTop()); sb.append("}"); return sb.toString(); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof BoundingBox == false) return false; BoundingBox other = (BoundingBox) obj; if (other.getWidth() == null ^ this.getWidth() == null) return false; if (other.getWidth() != null && other.getWidth().equals(this.getWidth()) == false) return false; if (other.getHeight() == null ^ this.getHeight() == null) return false; if (other.getHeight() != null && other.getHeight().equals(this.getHeight()) == false) return false; if (other.getLeft() == null ^ this.getLeft() == null) return false; if (other.getLeft() != null && other.getLeft().equals(this.getLeft()) == false) return false; if (other.getTop() == null ^ this.getTop() == null) return false; if (other.getTop() != null && other.getTop().equals(this.getTop()) == false) return false; return true; }
/** * Marshall the given parameter object. */ public void marshall(BoundingBox boundingBox, ProtocolMarshaller protocolMarshaller) { if (boundingBox == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(boundingBox.getWidth(), WIDTH_BINDING); protocolMarshaller.marshall(boundingBox.getHeight(), HEIGHT_BINDING); protocolMarshaller.marshall(boundingBox.getLeft(), LEFT_BINDING); protocolMarshaller.marshall(boundingBox.getTop(), TOP_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 + ((getWidth() == null) ? 0 : getWidth().hashCode()); hashCode = prime * hashCode + ((getHeight() == null) ? 0 : getHeight().hashCode()); hashCode = prime * hashCode + ((getLeft() == null) ? 0 : getLeft().hashCode()); hashCode = prime * hashCode + ((getTop() == null) ? 0 : getTop().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 (getWidth() != null) sb.append("Width: " + getWidth() + ","); if (getHeight() != null) sb.append("Height: " + getHeight() + ","); if (getLeft() != null) sb.append("Left: " + getLeft() + ","); if (getTop() != null) sb.append("Top: " + getTop()); sb.append("}"); return sb.toString(); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof BoundingBox == false) return false; BoundingBox other = (BoundingBox) obj; if (other.getWidth() == null ^ this.getWidth() == null) return false; if (other.getWidth() != null && other.getWidth().equals(this.getWidth()) == false) return false; if (other.getHeight() == null ^ this.getHeight() == null) return false; if (other.getHeight() != null && other.getHeight().equals(this.getHeight()) == false) return false; if (other.getLeft() == null ^ this.getLeft() == null) return false; if (other.getLeft() != null && other.getLeft().equals(this.getLeft()) == false) return false; if (other.getTop() == null ^ this.getTop() == null) return false; if (other.getTop() != null && other.getTop().equals(this.getTop()) == false) return false; return true; } }
public void marshall(BoundingBox boundingBox, AwsJsonWriter jsonWriter) throws Exception { jsonWriter.beginObject(); if (boundingBox.getWidth() != null) { Float width = boundingBox.getWidth(); jsonWriter.name("Width"); jsonWriter.value(width); } if (boundingBox.getHeight() != null) { Float height = boundingBox.getHeight(); jsonWriter.name("Height"); jsonWriter.value(height); } if (boundingBox.getLeft() != null) { Float left = boundingBox.getLeft(); jsonWriter.name("Left"); jsonWriter.value(left); } if (boundingBox.getTop() != null) { Float top = boundingBox.getTop(); jsonWriter.name("Top"); jsonWriter.value(top); } jsonWriter.endObject(); }