/** * 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("ListObjectsV2Request").add("Bucket", bucket()).add("Delimiter", delimiter()) .add("EncodingType", encodingTypeAsString()).add("MaxKeys", maxKeys()).add("Prefix", prefix()) .add("ContinuationToken", continuationToken()).add("FetchOwner", fetchOwner()).add("StartAfter", startAfter()) .add("RequestPayer", requestPayerAsString()).build(); }
@Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(bucket()); hashCode = 31 * hashCode + Objects.hashCode(delimiter()); hashCode = 31 * hashCode + Objects.hashCode(encodingTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(maxKeys()); hashCode = 31 * hashCode + Objects.hashCode(prefix()); hashCode = 31 * hashCode + Objects.hashCode(continuationToken()); hashCode = 31 * hashCode + Objects.hashCode(fetchOwner()); hashCode = 31 * hashCode + Objects.hashCode(startAfter()); hashCode = 31 * hashCode + Objects.hashCode(requestPayerAsString()); return hashCode; }
public <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) { switch (fieldName) { case "Bucket": return Optional.ofNullable(clazz.cast(bucket())); case "Delimiter": return Optional.ofNullable(clazz.cast(delimiter())); case "EncodingType": return Optional.ofNullable(clazz.cast(encodingTypeAsString())); case "MaxKeys": return Optional.ofNullable(clazz.cast(maxKeys())); case "Prefix": return Optional.ofNullable(clazz.cast(prefix())); case "ContinuationToken": return Optional.ofNullable(clazz.cast(continuationToken())); case "FetchOwner": return Optional.ofNullable(clazz.cast(fetchOwner())); case "StartAfter": return Optional.ofNullable(clazz.cast(startAfter())); case "RequestPayer": return Optional.ofNullable(clazz.cast(requestPayerAsString())); default: return Optional.empty(); } }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof ListObjectsV2Request)) { return false; } ListObjectsV2Request other = (ListObjectsV2Request) obj; return Objects.equals(bucket(), other.bucket()) && Objects.equals(delimiter(), other.delimiter()) && Objects.equals(encodingTypeAsString(), other.encodingTypeAsString()) && Objects.equals(maxKeys(), other.maxKeys()) && Objects.equals(prefix(), other.prefix()) && Objects.equals(continuationToken(), other.continuationToken()) && Objects.equals(fetchOwner(), other.fetchOwner()) && Objects.equals(startAfter(), other.startAfter()) && Objects.equals(requestPayerAsString(), other.requestPayerAsString()); }