/** * 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. */ @Override public String toString() { return ToString.builder("GetObjectRequest").add("Bucket", bucket()).add("IfMatch", ifMatch()) .add("IfModifiedSince", ifModifiedSince()).add("IfNoneMatch", ifNoneMatch()) .add("IfUnmodifiedSince", ifUnmodifiedSince()).add("Key", key()).add("Range", range()) .add("ResponseCacheControl", responseCacheControl()) .add("ResponseContentDisposition", responseContentDisposition()) .add("ResponseContentEncoding", responseContentEncoding()) .add("ResponseContentLanguage", responseContentLanguage()).add("ResponseContentType", responseContentType()) .add("ResponseExpires", responseExpires()).add("VersionId", versionId()) .add("SSECustomerAlgorithm", sseCustomerAlgorithm()) .add("SSECustomerKey", sseCustomerKey() == null ? null : "*** Sensitive Data Redacted ***") .add("SSECustomerKeyMD5", sseCustomerKeyMD5()).add("RequestPayer", requestPayerAsString()) .add("PartNumber", partNumber()).build(); }
return Optional.ofNullable(clazz.cast(bucket())); case "IfMatch": return Optional.ofNullable(clazz.cast(ifMatch())); case "IfModifiedSince": return Optional.ofNullable(clazz.cast(ifModifiedSince()));
@Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(bucket()); hashCode = 31 * hashCode + Objects.hashCode(ifMatch()); hashCode = 31 * hashCode + Objects.hashCode(ifModifiedSince()); hashCode = 31 * hashCode + Objects.hashCode(ifNoneMatch()); hashCode = 31 * hashCode + Objects.hashCode(ifUnmodifiedSince()); hashCode = 31 * hashCode + Objects.hashCode(key()); hashCode = 31 * hashCode + Objects.hashCode(range()); hashCode = 31 * hashCode + Objects.hashCode(responseCacheControl()); hashCode = 31 * hashCode + Objects.hashCode(responseContentDisposition()); hashCode = 31 * hashCode + Objects.hashCode(responseContentEncoding()); hashCode = 31 * hashCode + Objects.hashCode(responseContentLanguage()); hashCode = 31 * hashCode + Objects.hashCode(responseContentType()); hashCode = 31 * hashCode + Objects.hashCode(responseExpires()); hashCode = 31 * hashCode + Objects.hashCode(versionId()); hashCode = 31 * hashCode + Objects.hashCode(sseCustomerAlgorithm()); hashCode = 31 * hashCode + Objects.hashCode(sseCustomerKey()); hashCode = 31 * hashCode + Objects.hashCode(sseCustomerKeyMD5()); hashCode = 31 * hashCode + Objects.hashCode(requestPayerAsString()); hashCode = 31 * hashCode + Objects.hashCode(partNumber()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof GetObjectRequest)) { return false; } GetObjectRequest other = (GetObjectRequest) obj; return Objects.equals(bucket(), other.bucket()) && Objects.equals(ifMatch(), other.ifMatch()) && Objects.equals(ifModifiedSince(), other.ifModifiedSince()) && Objects.equals(ifNoneMatch(), other.ifNoneMatch()) && Objects.equals(ifUnmodifiedSince(), other.ifUnmodifiedSince()) && Objects.equals(key(), other.key()) && Objects.equals(range(), other.range()) && Objects.equals(responseCacheControl(), other.responseCacheControl()) && Objects.equals(responseContentDisposition(), other.responseContentDisposition()) && Objects.equals(responseContentEncoding(), other.responseContentEncoding()) && Objects.equals(responseContentLanguage(), other.responseContentLanguage()) && Objects.equals(responseContentType(), other.responseContentType()) && Objects.equals(responseExpires(), other.responseExpires()) && Objects.equals(versionId(), other.versionId()) && Objects.equals(sseCustomerAlgorithm(), other.sseCustomerAlgorithm()) && Objects.equals(sseCustomerKey(), other.sseCustomerKey()) && Objects.equals(sseCustomerKeyMD5(), other.sseCustomerKeyMD5()) && Objects.equals(requestPayerAsString(), other.requestPayerAsString()) && Objects.equals(partNumber(), other.partNumber()); }