[#1] provide naming conventions

Signed-off-by: Ori Bruk <o.bruk@yadro.com>
This commit is contained in:
Ori Bruk 2024-07-23 22:24:17 +03:00
parent a7fab6f314
commit bf2f19f08d
103 changed files with 416 additions and 417 deletions

View file

@ -0,0 +1,76 @@
package info.frostfs.sdk.jdo;
import info.frostfs.sdk.dto.object.ObjectHeader;
import java.io.FileInputStream;
import static java.util.Objects.isNull;
public class PutObjectParameters {
private static final String ERROR_TEMPLATE = "%s value cannot be null.";
public ObjectHeader header;
public FileInputStream payload;
public boolean clientCut;
public int bufferMaxSize;
public PutObjectParameters(ObjectHeader header, FileInputStream payload, boolean clientCut, int bufferMaxSize) {
this.header = header;
this.payload = payload;
this.clientCut = clientCut;
this.bufferMaxSize = bufferMaxSize;
}
public PutObjectParameters(ObjectHeader header, FileInputStream payload) {
this.header = header;
this.payload = payload;
}
public ObjectHeader getHeader() {
return header;
}
public void setHeader(ObjectHeader header) {
this.header = header;
}
public FileInputStream getPayload() {
return payload;
}
public void setPayload(FileInputStream payload) {
this.payload = payload;
}
public boolean isClientCut() {
return clientCut;
}
public void setClientCut(boolean clientCut) {
this.clientCut = clientCut;
}
public int getBufferMaxSize() {
return bufferMaxSize;
}
public void setBufferMaxSize(int bufferMaxSize) {
this.bufferMaxSize = bufferMaxSize;
}
public void validate() {
StringBuilder errorMessage = new StringBuilder();
if (isNull(header)) {
errorMessage.append(String.format(ERROR_TEMPLATE, "Header")).append(System.lineSeparator());
}
if (isNull(payload)) {
errorMessage.append(String.format(ERROR_TEMPLATE, "Payload")).append(System.lineSeparator());
}
if (errorMessage.length() != 0) {
throw new IllegalArgumentException(errorMessage.toString());
}
}
}