This commit is contained in:
Gary Gregory 2017-10-04 15:00:20 -06:00
parent aa0e53cc0c
commit ad606e45bf
1 changed files with 64 additions and 47 deletions

View File

@ -100,13 +100,15 @@ public class EntityBuilder {
} }
/** /**
* Sets entity content as a string. This method is mutually exclusive with * Sets entity content as a string. This method is mutually exclusive with:
* {@link #setBinary(byte[])}, * <ul>
* {@link #setStream(java.io.InputStream)} , * <li>{@link #setBinary(byte[])}</li>
* {@link #setSerializable(java.io.Serializable)} , * <li>{@link #setStream(java.io.InputStream)}</li>
* {@link #setParameters(java.util.List)}, * <li>{@link #setSerializable(java.io.Serializable)}</li>
* {@link #setParameters(org.apache.http.NameValuePair...)} * <li>{@link #setParameters(java.util.List)}</li>
* {@link #setFile(java.io.File)} methods. * <li>{@link #setParameters(org.apache.http.NameValuePair...)}</li>
* <li>{@link #setFile(java.io.File)}</li>
* <ul>
*/ */
public EntityBuilder setText(final String text) { public EntityBuilder setText(final String text) {
clearContent(); clearContent();
@ -123,13 +125,16 @@ public class EntityBuilder {
} }
/** /**
* Sets entity content as a byte array. This method is mutually exclusive with * Sets entity content as a byte array. This method is mutually exclusive
* {@link #setText(String)}, * with:
* {@link #setStream(java.io.InputStream)} , * <ul>
* {@link #setSerializable(java.io.Serializable)} , * <li>{@link #setText(String)}</li>
* {@link #setParameters(java.util.List)}, * <li>{@link #setStream(java.io.InputStream)}</li>
* {@link #setParameters(org.apache.http.NameValuePair...)} * <li>{@link #setSerializable(java.io.Serializable)}</li>
* {@link #setFile(java.io.File)} methods. * <li>{@link #setParameters(java.util.List)}</li>
* <li>{@link #setParameters(org.apache.http.NameValuePair...)}</li>
* <li>{@link #setFile(java.io.File)}</li>
* </ul>
*/ */
public EntityBuilder setBinary(final byte[] binary) { public EntityBuilder setBinary(final byte[] binary) {
clearContent(); clearContent();
@ -146,13 +151,16 @@ public class EntityBuilder {
} }
/** /**
* Sets entity content as a {@link InputStream}. This method is mutually exclusive with * Sets entity content as a {@link InputStream}. This method is mutually
* {@link #setText(String)}, * exclusive with:
* {@link #setBinary(byte[])}, * <ul>
* {@link #setSerializable(java.io.Serializable)} , * <li>{@link #setText(String)}</li>
* {@link #setParameters(java.util.List)}, * <li>{@link #setBinary(byte[])}</li>
* {@link #setParameters(org.apache.http.NameValuePair...)} * <li>{@link #setSerializable(java.io.Serializable)}</li>
* {@link #setFile(java.io.File)} methods. * <li>{@link #setParameters(java.util.List)}</li>
* <li>{@link #setParameters(org.apache.http.NameValuePair...)}</li>
* <li>{@link #setFile(java.io.File)}</li>
* </ul>
*/ */
public EntityBuilder setStream(final InputStream stream) { public EntityBuilder setStream(final InputStream stream) {
clearContent(); clearContent();
@ -170,12 +178,15 @@ public class EntityBuilder {
} }
/** /**
* Sets entity content as a parameter list. This method is mutually exclusive with * Sets entity content as a parameter list. This method is mutually
* {@link #setText(String)}, * exclusive with:
* {@link #setBinary(byte[])}, * <ul>
* {@link #setStream(java.io.InputStream)} , * <li>{@link #setText(String)}</li>
* {@link #setSerializable(java.io.Serializable)} , * <li>{@link #setBinary(byte[])}</li>
* {@link #setFile(java.io.File)} methods. * <li>{@link #setStream(java.io.InputStream)}</li>
* <li>{@link #setSerializable(java.io.Serializable)}</li>
* <li>{@link #setFile(java.io.File)}</li>
* </ul>
*/ */
public EntityBuilder setParameters(final List<NameValuePair> parameters) { public EntityBuilder setParameters(final List<NameValuePair> parameters) {
clearContent(); clearContent();
@ -184,12 +195,14 @@ public class EntityBuilder {
} }
/** /**
* Sets entity content as a parameter list. This method is mutually exclusive with * Sets entity content as a parameter list. This method is mutually exclusive with:
* {@link #setText(String)}, * <ul>
* {@link #setBinary(byte[])}, * <li>{@link #setText(String)}</li>
* {@link #setStream(java.io.InputStream)} , * <li>{@link #setBinary(byte[])}</li>
* {@link #setSerializable(java.io.Serializable)} , * <li>{@link #setStream(java.io.InputStream)}</li>
* {@link #setFile(java.io.File)} methods. * <li>{@link #setSerializable(java.io.Serializable)}</li>
* <li>{@link #setFile(java.io.File)}</li>
* </ul>
*/ */
public EntityBuilder setParameters(final NameValuePair... parameters) { public EntityBuilder setParameters(final NameValuePair... parameters) {
return setParameters(Arrays.asList(parameters)); return setParameters(Arrays.asList(parameters));
@ -204,13 +217,15 @@ public class EntityBuilder {
} }
/** /**
* Sets entity content as a {@link Serializable}. This method is mutually exclusive with * Sets entity content as a {@link Serializable}. This method is mutually exclusive with:
* {@link #setText(String)}, * <ul>
* {@link #setBinary(byte[])}, * <li>{@link #setText(String)}</li>
* {@link #setStream(java.io.InputStream)} , * <li>{@link #setBinary(byte[])}</li>
* {@link #setParameters(java.util.List)}, * <li>{@link #setStream(java.io.InputStream)}</li>
* {@link #setParameters(org.apache.http.NameValuePair...)} * <li>{@link #setParameters(java.util.List)}</li>
* {@link #setFile(java.io.File)} methods. * <li>{@link #setParameters(org.apache.http.NameValuePair...)}</li>
* <li>{@link #setFile(java.io.File)}</li>
* </ul>
*/ */
public EntityBuilder setSerializable(final Serializable serializable) { public EntityBuilder setSerializable(final Serializable serializable) {
clearContent(); clearContent();
@ -227,13 +242,15 @@ public class EntityBuilder {
} }
/** /**
* Sets entity content as a {@link File}. This method is mutually exclusive with * Sets entity content as a {@link File}. This method is mutually exclusive with:
* {@link #setText(String)}, * <ul>
* {@link #setBinary(byte[])}, * <li>{@link #setText(String)}</li>
* {@link #setStream(java.io.InputStream)} , * <li>{@link #setBinary(byte[])}</li>
* {@link #setParameters(java.util.List)}, * <li>{@link #setStream(java.io.InputStream)}</li>
* {@link #setParameters(org.apache.http.NameValuePair...)} * <li>{@link #setParameters(java.util.List)}</li>
* {@link #setSerializable(java.io.Serializable)} methods. * <li>{@link #setParameters(org.apache.http.NameValuePair...)}</li>
* <li>{@link #setSerializable(java.io.Serializable)}</li>
* <ul>
*/ */
public EntityBuilder setFile(final File file) { public EntityBuilder setFile(final File file) {
clearContent(); clearContent();