com.ionoscloud.s3.SelectObjectContentArgs Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ionos-cloud-sdk-s3 Show documentation
Show all versions of ionos-cloud-sdk-s3 Show documentation
IONOS Java SDK for Amazon S3 Compatible Cloud Storage
The newest version!
package com.ionoscloud.s3;
import com.ionoscloud.s3.messages.InputSerialization;
import com.ionoscloud.s3.messages.OutputSerialization;
import java.util.Objects;
/**
* Argument class of {@link ApiAsyncClient#selectObjectContent} and {@link
* ApiClient#selectObjectContent}.
*/
public class SelectObjectContentArgs extends ObjectReadArgs {
private String sqlExpression;
private InputSerialization inputSerialization;
private OutputSerialization outputSerialization;
private Boolean requestProgress;
private Long scanStartRange;
private Long scanEndRange;
public Long scanEndRange() {
return scanEndRange;
}
public Long scanStartRange() {
return scanStartRange;
}
public Boolean requestProgress() {
return requestProgress;
}
public OutputSerialization outputSerialization() {
return outputSerialization;
}
public InputSerialization inputSerialization() {
return inputSerialization;
}
public String sqlExpression() {
return sqlExpression;
}
public static Builder builder() {
return new Builder();
}
/** Argument builder of {@link SelectObjectContentArgs}. */
public static final class Builder
extends ObjectReadArgs.Builder {
private void validateSqlExpression(String se) {
validateNotEmptyString(se, "sqlExpression");
}
public Builder sqlExpression(String sqlExpression) {
validateSqlExpression(sqlExpression);
operations.add(args -> args.sqlExpression = sqlExpression);
return this;
}
private void validateInputSerialization(InputSerialization is) {
validateNotNull(is, "inputSerialization");
}
public Builder inputSerialization(InputSerialization inputSerialization) {
validateInputSerialization(inputSerialization);
operations.add(args -> args.inputSerialization = inputSerialization);
return this;
}
private void validateOutputSerialization(OutputSerialization os) {
validateNotNull(os, "outputSerialization");
}
public Builder outputSerialization(OutputSerialization outputSerialization) {
validateOutputSerialization(outputSerialization);
operations.add(args -> args.outputSerialization = outputSerialization);
return this;
}
public Builder requestProgress(Boolean requestProgress) {
operations.add(args -> args.requestProgress = requestProgress);
return this;
}
public Builder scanStartRange(Long scanStartRange) {
operations.add(args -> args.scanStartRange = scanStartRange);
return this;
}
public Builder scanEndRange(Long scanEndRange) {
operations.add(args -> args.scanEndRange = scanEndRange);
return this;
}
@Override
protected void validate(SelectObjectContentArgs args) {
super.validate(args);
validateSqlExpression(args.sqlExpression());
validateInputSerialization(args.inputSerialization());
validateOutputSerialization(args.outputSerialization());
}
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof SelectObjectContentArgs)) return false;
if (!super.equals(o)) return false;
SelectObjectContentArgs that = (SelectObjectContentArgs) o;
return Objects.equals(sqlExpression, that.sqlExpression)
&& Objects.equals(inputSerialization, that.inputSerialization)
&& Objects.equals(outputSerialization, that.outputSerialization)
&& Objects.equals(requestProgress, that.requestProgress)
&& Objects.equals(scanStartRange, that.scanStartRange)
&& Objects.equals(scanEndRange, that.scanEndRange);
}
@Override
public int hashCode() {
return Objects.hash(
super.hashCode(),
sqlExpression,
inputSerialization,
outputSerialization,
requestProgress,
scanStartRange,
scanEndRange);
}
}