@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getBucket() == null) ? 0 : getBucket().hashCode()); hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getVersion() == null) ? 0 : getVersion().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 (getBucket() != null) sb.append("Bucket: ").append(getBucket()).append(","); if (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getVersion() != null) sb.append("Version: ").append(getVersion()); sb.append("}"); return sb.toString(); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof S3Object == false) return false; S3Object other = (S3Object) obj; if (other.getBucket() == null ^ this.getBucket() == null) return false; if (other.getBucket() != null && other.getBucket().equals(this.getBucket()) == false) return false; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getVersion() == null ^ this.getVersion() == null) return false; if (other.getVersion() != null && other.getVersion().equals(this.getVersion()) == false) return false; return true; }
/** * Marshall the given parameter object. */ public void marshall(S3Object s3Object, ProtocolMarshaller protocolMarshaller) { if (s3Object == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(s3Object.getBucket(), BUCKET_BINDING); protocolMarshaller.marshall(s3Object.getName(), NAME_BINDING); protocolMarshaller.marshall(s3Object.getVersion(), VERSION_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 + ((getBucket() == null) ? 0 : getBucket().hashCode()); hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getVersion() == null) ? 0 : getVersion().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 (getBucket() != null) sb.append("Bucket: " + getBucket() + ","); if (getName() != null) sb.append("Name: " + getName() + ","); if (getVersion() != null) sb.append("Version: " + getVersion()); sb.append("}"); return sb.toString(); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof S3Object == false) return false; S3Object other = (S3Object) obj; if (other.getBucket() == null ^ this.getBucket() == null) return false; if (other.getBucket() != null && other.getBucket().equals(this.getBucket()) == false) return false; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getVersion() == null ^ this.getVersion() == null) return false; if (other.getVersion() != null && other.getVersion().equals(this.getVersion()) == false) return false; return true; } }
public void marshall(S3Object s3Object, AwsJsonWriter jsonWriter) throws Exception { jsonWriter.beginObject(); if (s3Object.getBucket() != null) { String bucket = s3Object.getBucket(); jsonWriter.name("Bucket"); jsonWriter.value(bucket); } if (s3Object.getName() != null) { String name = s3Object.getName(); jsonWriter.name("Name"); jsonWriter.value(name); } if (s3Object.getVersion() != null) { String version = s3Object.getVersion(); jsonWriter.name("Version"); jsonWriter.value(version); } jsonWriter.endObject(); }