com.imperva.shcf4j.request.body.multipart.StringPartBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of shcf4j-api Show documentation
Show all versions of shcf4j-api Show documentation
The Simple HTTP Client Facade for Java (SHCF4J) serves as a simple facade or abstraction for various HTTP client frameworks (e.g. java.net.HttpURLConnection, Apache HttpClient, etc.) allowing the end user to plug in the desired HTTP client framework at deployment time.
The newest version!
package com.imperva.shcf4j.request.body.multipart;
import com.imperva.shcf4j.entity.ContentType;
import java.util.Objects;
/**
* StringPartBuilder
*
* @author maxim.kirilov
*/
public class StringPartBuilder extends PartBuilder {
protected String value;
StringPartBuilder() {
contentType(ContentType.createTextPlain()); // Default, in order to preserve behavior between different providers (which can use different defaults)
}
@Override
public Part build() {
Objects.requireNonNull(value, "value");
return new StringPart(this);
}
public StringPartBuilder value(String value) {
this.value = value;
return this;
}
}