This is an automated email from the ASF dual-hosted git repository.
jamesbognar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/juneau.git
The following commit(s) were added to refs/heads/master by this push:
new c6b127f Cleanup.
c6b127f is described below
commit c6b127fee8379f3e2d0045352f1af3d2308a8a2e
Author: JamesBognar <[email protected]>
AuthorDate: Sun May 9 12:28:52 2021 -0400
Cleanup.
---
.../java/org/apache/juneau/PropertyNamerDLC.java | 19 +-
...ropertyNamerDLC.java => PropertyNamerDUCS.java} | 46 ++--
.../java/org/apache/juneau/PropertyNamerULC.java | 19 +-
.../java/org/apache/juneau/http/HttpParts.java | 42 ++++
.../http/entity/SerializedEntityBuilder.java | 54 +++-
.../apache/juneau/http/part/PartListBuilder.java | 280 +++++++++++++++++++--
.../org/apache/juneau/http/response/Accepted.java | 2 -
.../juneau/http/response/AlreadyReported.java | 2 -
.../org/apache/juneau/http/response/Continue.java | 2 -
.../org/apache/juneau/http/response/Created.java | 2 -
.../apache/juneau/http/response/EarlyHints.java | 2 -
.../org/apache/juneau/http/response/Found.java | 2 -
.../org/apache/juneau/http/response/IMUsed.java | 2 -
.../juneau/http/response/MovedPermanently.java | 2 -
.../apache/juneau/http/response/MultiStatus.java | 2 -
.../juneau/http/response/MultipleChoices.java | 2 -
.../org/apache/juneau/http/response/NoContent.java | 2 -
.../http/response/NonAuthoritiveInformation.java | 2 -
.../apache/juneau/http/response/NotModified.java | 2 -
.../java/org/apache/juneau/http/response/Ok.java | 2 -
.../juneau/http/response/PartialContent.java | 2 -
.../juneau/http/response/PermanentRedirect.java | 2 -
.../apache/juneau/http/response/Processing.java | 2 -
.../apache/juneau/http/response/ResetContent.java | 2 -
.../org/apache/juneau/http/response/SeeOther.java | 2 -
.../juneau/http/response/SwitchingProtocols.java | 2 -
.../juneau/http/response/TemporaryRedirect.java | 2 -
.../org/apache/juneau/http/response/UseProxy.java | 2 -
28 files changed, 404 insertions(+), 100 deletions(-)
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyNamerDLC.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyNamerDLC.java
index 43d0e5f..97b6c2c 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyNamerDLC.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyNamerDLC.java
@@ -12,6 +12,9 @@
//
***************************************************************************************************************************
package org.apache.juneau;
+import static java.lang.Character.*;
+import static org.apache.juneau.internal.StringUtils.*;
+
/**
* Converts property names to dashed-lower-case format.
*
@@ -24,16 +27,19 @@ package org.apache.juneau;
*/
public final class PropertyNamerDLC implements PropertyNamer {
+ /** Reusable instance. */
+ public static final PropertyNamer INSTANCE = new PropertyNamerDLC();
+
@Override /* PropertyNamer */
public String getPropertyName(String name) {
- if (name == null || name.isEmpty())
+ if (isEmpty(name))
return name;
int numUCs = 0;
- boolean isPrevUC = Character.isUpperCase(name.charAt(0));
+ boolean isPrevUC = isUpperCase(name.charAt(0));
for (int i = 1; i < name.length(); i++) {
char c = name.charAt(i);
- if (Character.isUpperCase(c)) {
+ if (isUpperCase(c)) {
if (! isPrevUC)
numUCs++;
isPrevUC = true;
@@ -43,16 +49,15 @@ public final class PropertyNamerDLC implements
PropertyNamer {
}
char[] name2 = new char[name.length() + numUCs];
- isPrevUC = Character.isUpperCase(name.charAt(0));
- name2[0] = Character.toLowerCase(name.charAt(0));
+ isPrevUC = isUpperCase(name.charAt(0));
int ni = 0;
for (int i = 0; i < name.length(); i++) {
char c = name.charAt(i);
- if (Character.isUpperCase(c)) {
+ if (isUpperCase(c)) {
if (! isPrevUC)
name2[ni++] = '-';
isPrevUC = true;
- name2[ni++] = Character.toLowerCase(c);
+ name2[ni++] = toLowerCase(c);
} else {
isPrevUC = false;
name2[ni++] = c;
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyNamerDLC.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyNamerDUCS.java
similarity index 68%
copy from
juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyNamerDLC.java
copy to
juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyNamerDUCS.java
index 43d0e5f..8b504bc 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyNamerDLC.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyNamerDUCS.java
@@ -12,28 +12,34 @@
//
***************************************************************************************************************************
package org.apache.juneau;
+import static java.lang.Character.*;
+import static org.apache.juneau.internal.StringUtils.*;
+
/**
- * Converts property names to dashed-lower-case format.
+ * Converts property names to dashed-upper-case-start format.
*
* <h5 class='section'>Example:</h5>
* <ul>
- * <li><js>"fooBar"</js> -> <js>"foo-bar"</js>
- * <li><js>"fooBarURL"</js> -> <js>"foo-bar-url"</js>
- * <li><js>"FooBarURL"</js> -> <js>"foo-bar-url"</js>
+ * <li><js>"fooBar"</js> -> <js>"Foo-Bar"</js>
+ * <li><js>"fooBarURL"</js> -> <js>"Foo-Bar-Url"</js>
+ * <li><js>"FooBarURL"</js> -> <js>"Foo-Bar-Url"</js>
* </ul>
*/
-public final class PropertyNamerDLC implements PropertyNamer {
+public final class PropertyNamerDUCS implements PropertyNamer {
+
+ /** Reusable instance. */
+ public static final PropertyNamer INSTANCE = new PropertyNamerDUCS();
@Override /* PropertyNamer */
public String getPropertyName(String name) {
- if (name == null || name.isEmpty())
+ if (isEmpty(name))
return name;
int numUCs = 0;
- boolean isPrevUC = Character.isUpperCase(name.charAt(0));
+ boolean isPrevUC = isUpperCase(name.charAt(0));
for (int i = 1; i < name.length(); i++) {
char c = name.charAt(i);
- if (Character.isUpperCase(c)) {
+ if (isUpperCase(c)) {
if (! isPrevUC)
numUCs++;
isPrevUC = true;
@@ -43,19 +49,25 @@ public final class PropertyNamerDLC implements
PropertyNamer {
}
char[] name2 = new char[name.length() + numUCs];
- isPrevUC = Character.isUpperCase(name.charAt(0));
- name2[0] = Character.toLowerCase(name.charAt(0));
+ isPrevUC = true;
int ni = 0;
for (int i = 0; i < name.length(); i++) {
char c = name.charAt(i);
- if (Character.isUpperCase(c)) {
- if (! isPrevUC)
- name2[ni++] = '-';
- isPrevUC = true;
- name2[ni++] = Character.toLowerCase(c);
+ if (i == 0) {
+ name2[ni++] = toUpperCase(c);
} else {
- isPrevUC = false;
- name2[ni++] = c;
+ if (isUpperCase(c)) {
+ if (! isPrevUC) {
+ name2[ni++] = '-';
+ name2[ni++] = toUpperCase(c);
+ } else {
+ name2[ni++] = toLowerCase(c);
+ }
+ isPrevUC = true;
+ } else {
+ isPrevUC = false;
+ name2[ni++] = c;
+ }
}
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyNamerULC.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyNamerULC.java
index 0ede1d0..fa5a865 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyNamerULC.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/PropertyNamerULC.java
@@ -12,6 +12,9 @@
//
***************************************************************************************************************************
package org.apache.juneau;
+import static java.lang.Character.*;
+import static org.apache.juneau.internal.StringUtils.*;
+
/**
* Converts property names to underscore-lower-case format.
*
@@ -24,16 +27,19 @@ package org.apache.juneau;
*/
public final class PropertyNamerULC implements PropertyNamer {
+ /** Reusable instance. */
+ public static final PropertyNamer INSTANCE = new PropertyNamerULC();
+
@Override /* PropertyNamer */
public String getPropertyName(String name) {
- if (name == null || name.isEmpty())
+ if (isEmpty(name))
return name;
int numUCs = 0;
- boolean isPrevUC = Character.isUpperCase(name.charAt(0));
+ boolean isPrevUC = isUpperCase(name.charAt(0));
for (int i = 1; i < name.length(); i++) {
char c = name.charAt(i);
- if (Character.isUpperCase(c)) {
+ if (isUpperCase(c)) {
if (! isPrevUC)
numUCs++;
isPrevUC = true;
@@ -43,16 +49,15 @@ public final class PropertyNamerULC implements
PropertyNamer {
}
char[] name2 = new char[name.length() + numUCs];
- isPrevUC = Character.isUpperCase(name.charAt(0));
- name2[0] = Character.toLowerCase(name.charAt(0));
+ isPrevUC = isUpperCase(name.charAt(0));
int ni = 0;
for (int i = 0; i < name.length(); i++) {
char c = name.charAt(i);
- if (Character.isUpperCase(c)) {
+ if (isUpperCase(c)) {
if (! isPrevUC)
name2[ni++] = '_';
isPrevUC = true;
- name2[ni++] = Character.toLowerCase(c);
+ name2[ni++] = toLowerCase(c);
} else {
isPrevUC = false;
name2[ni++] = c;
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/HttpParts.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/HttpParts.java
index 00c1344..c6adf5e 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/HttpParts.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/HttpParts.java
@@ -12,12 +12,17 @@
//
***************************************************************************************************************************
package org.apache.juneau.http;
+import static org.apache.juneau.internal.ExceptionUtils.*;
+import static org.apache.juneau.internal.StringUtils.*;
+
import java.time.*;
import java.util.*;
import java.util.function.*;
import org.apache.http.*;
+import org.apache.juneau.http.header.*;
import org.apache.juneau.http.part.*;
+import org.apache.juneau.reflect.*;
/**
* Standard predefined HTTP headers.
@@ -401,4 +406,41 @@ public class HttpParts {
public static PartList partList(Object...pairs) {
return PartList.ofPairs(pairs);
}
+
+
//-----------------------------------------------------------------------------------------------------------------
+ // Utility methods.
+
//-----------------------------------------------------------------------------------------------------------------
+
+ /**
+ * Utility method for converting an arbitrary object to a {@link
NameValuePair}.
+ *
+ * @param o
+ * The object to cast or convert to a {@link NameValuePair}.
+ * @return Either the same object cast as a {@link NameValuePair} or
converted to a {@link NameValuePair}.
+ */
+ @SuppressWarnings("rawtypes")
+ public static NameValuePair cast(Object o) {
+ if (o instanceof NameValuePair)
+ return (NameValuePair)o;
+ if (o instanceof Headerable) {
+ Header x = ((Headerable)o).asHeader();
+ return BasicPart.of(x.getName(), x.getValue());
+ }
+ if (o instanceof Map.Entry) {
+ Map.Entry e = (Map.Entry)o;
+ return BasicPart.of(stringify(e.getKey()),
e.getValue());
+ }
+ throw runtimeException("Object of type {0} could not be
converted to a Part.", o == null ? null : o.getClass().getName());
+ }
+
+ /**
+ * Returns <jk>true</jk> if the {@link #cast(Object)} method can be
used on the specified object.
+ *
+ * @param o The object to check.
+ * @return <jk>true</jk> if the {@link #cast(Object)} method can be
used on the specified object.
+ */
+ public static boolean canCast(Object o) {
+ ClassInfo ci = ClassInfo.of(o);
+ return ci != null && ci.isChildOfAny(Headerable.class,
NameValuePair.class, NameValuePairable.class, Map.Entry.class);
+ }
}
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/entity/SerializedEntityBuilder.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/entity/SerializedEntityBuilder.java
index 860b453..1cad465 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/entity/SerializedEntityBuilder.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/entity/SerializedEntityBuilder.java
@@ -14,6 +14,7 @@ package org.apache.juneau.http.entity;
import static org.apache.juneau.internal.ExceptionUtils.*;
+import java.io.*;
import java.util.function.*;
import org.apache.http.*;
@@ -21,6 +22,7 @@ import org.apache.juneau.httppart.*;
import org.apache.juneau.internal.*;
import org.apache.juneau.serializer.*;
import org.apache.juneau.http.HttpHeaders;
+import org.apache.juneau.http.header.*;
/**
@@ -104,17 +106,65 @@ public class SerializedEntityBuilder<T extends
SerializedEntity> extends HttpEnt
// <FluentSetters>
- @Override
+ @Override /* GENERATED - HttpEntityBuilder */
+ public SerializedEntityBuilder<T> cached() throws IOException{
+ super.cached();
+ return this;
+ }
+
+ @Override /* GENERATED - HttpEntityBuilder */
+ public SerializedEntityBuilder<T> chunked() {
+ super.chunked();
+ return this;
+ }
+
+ @Override /* GENERATED - HttpEntityBuilder */
+ public SerializedEntityBuilder<T> chunked(boolean value) {
+ super.chunked(value);
+ return this;
+ }
+
+ @Override /* GENERATED - HttpEntityBuilder */
public SerializedEntityBuilder<T> content(Object value) {
super.content(value);
return this;
}
- @Override
+ @Override /* GENERATED - HttpEntityBuilder */
+ public SerializedEntityBuilder<T> contentEncoding(String value) {
+ super.contentEncoding(value);
+ return this;
+ }
+
+ @Override /* GENERATED - HttpEntityBuilder */
+ public SerializedEntityBuilder<T> contentEncoding(ContentEncoding
value) {
+ super.contentEncoding(value);
+ return this;
+ }
+
+ @Override /* GENERATED - HttpEntityBuilder */
+ public SerializedEntityBuilder<T> contentLength(long value) {
+ super.contentLength(value);
+ return this;
+ }
+
+ @Override /* GENERATED - HttpEntityBuilder */
public SerializedEntityBuilder<T> contentSupplier(Supplier<?> value) {
super.contentSupplier(value);
return this;
}
+ @Override /* GENERATED - HttpEntityBuilder */
+ public SerializedEntityBuilder<T> contentType(String value) {
+ super.contentType(value);
+ return this;
+ }
+
+ @Override /* GENERATED - HttpEntityBuilder */
+ public SerializedEntityBuilder<T> contentType(ContentType value) {
+ super.contentType(value);
+ return this;
+ }
+
// </FluentSetters>
}
\ No newline at end of file
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/part/PartListBuilder.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/part/PartListBuilder.java
index 3668965..a02be9e 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/part/PartListBuilder.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/part/PartListBuilder.java
@@ -13,11 +13,13 @@
package org.apache.juneau.http.part;
import static org.apache.juneau.internal.StringUtils.*;
+import static org.apache.juneau.internal.ExceptionUtils.*;
import java.util.*;
import java.util.function.*;
import org.apache.http.*;
+import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
import org.apache.juneau.internal.*;
import org.apache.juneau.svl.*;
@@ -58,6 +60,27 @@ public class PartListBuilder {
}
/**
+ * Copy constructor.
+ *
+ * @param copyFrom The bean to copy from.
+ */
+ protected PartListBuilder(PartListBuilder copyFrom) {
+ entries = new ArrayList<>(copyFrom.entries);
+ defaultEntries = copyFrom.defaultEntries == null ? null : new
ArrayList<>(copyFrom.defaultEntries);
+ varResolver = copyFrom.varResolver;
+ caseInsensitive = copyFrom.caseInsensitive;
+ }
+
+ /**
+ * Creates a modifiable copy of this builder.
+ *
+ * @return A shallow copy of this builder.
+ */
+ public PartListBuilder copy() {
+ return new PartListBuilder(this);
+ }
+
+ /**
* Creates a new {@link PartList} bean based on the contents of this
builder.
*
* @return A new {@link PartList} bean.
@@ -154,7 +177,7 @@ public class PartListBuilder {
}
/**
- * Adds the specified parts to the end of the parts in this builder.
+ * Adds the specified part to the end of the parts in this builder.
*
* @param value The parts to add. <jk>null</jk> values are ignored.
* @return This object (for method chaining).
@@ -177,7 +200,7 @@ public class PartListBuilder {
* @return This object (for method chaining).
*/
public PartListBuilder append(String name, Object value) {
- return append(part(name, value));
+ return append(createPart(name, value));
}
/**
@@ -194,7 +217,7 @@ public class PartListBuilder {
* @return This object (for method chaining).
*/
public PartListBuilder append(String name, Supplier<?> value) {
- return append(part(name, value));
+ return append(createPart(name, value));
}
/**
@@ -218,7 +241,7 @@ public class PartListBuilder {
* @return This object (for method chaining).
*/
@FluentSetter
- public PartListBuilder append(List<NameValuePair> values) {
+ public PartListBuilder append(List<? extends NameValuePair> values) {
if (values != null)
for (int i = 0, j = values.size(); i < j; i++)
append(values.get(i));
@@ -262,7 +285,7 @@ public class PartListBuilder {
* @return This object (for method chaining).
*/
public PartListBuilder prepend(String name, Object value) {
- return prepend(part(name, value));
+ return prepend(createPart(name, value));
}
/**
@@ -279,7 +302,7 @@ public class PartListBuilder {
* @return This object (for method chaining).
*/
public PartListBuilder prepend(String name, Supplier<?> value) {
- return prepend(part(name, value));
+ return prepend(createPart(name, value));
}
/**
@@ -302,7 +325,7 @@ public class PartListBuilder {
* @return This object (for method chaining).
*/
@FluentSetter
- public PartListBuilder prepend(List<NameValuePair> values) {
+ public PartListBuilder prepend(List<? extends NameValuePair> values) {
if (values != null)
entries.addAll(0, values);
return this;
@@ -355,7 +378,7 @@ public class PartListBuilder {
* @return This object (for method chaining).
*/
@FluentSetter
- public PartListBuilder remove(List<NameValuePair> values) {
+ public PartListBuilder remove(List<? extends NameValuePair> values) {
for (int i = 0, j = values.size(); i < j; i++) /* See
HTTPCORE-361 */
remove(values.get(i));
return this;
@@ -439,29 +462,29 @@ public class PartListBuilder {
}
/**
- * Replaces the first occurrence of the parts with the same name.
+ * Adds or replaces the part with the specified name.
*
* @param name The part name.
* @param value The part value.
* @return This object (for method chaining).
*/
public PartListBuilder set(String name, Object value) {
- return set(part(name, value));
+ return set(createPart(name, value));
}
/**
- * Replaces the first occurrence of the parts with the same name.
+ * Adds or replaces the part with the specified name.
*
* @param name The part name.
* @param value The part value.
* @return This object (for method chaining).
*/
public PartListBuilder set(String name, Supplier<?> value) {
- return set(part(name, value));
+ return set(createPart(name, value));
}
/**
- * Replaces the first occurrence of the parts with the same name.
+ * Adds or replaces the parts with the specified names.
*
* <p>
* If no part with the same name is found the given part is added to
the end of the list.
@@ -470,7 +493,7 @@ public class PartListBuilder {
* @return This object (for method chaining).
*/
@FluentSetter
- public PartListBuilder set(List<NameValuePair> values) {
+ public PartListBuilder set(List<? extends NameValuePair> values) {
if (values != null) {
for (int i1 = 0, j1 = values.size(); i1 < j1; i1++) {
@@ -498,7 +521,7 @@ public class PartListBuilder {
}
/**
- * Replaces the first occurrence of the parts with the same name.
+ * Adds or replaces the parts with the specified names.
*
* <p>
* If no part with the same name is found the given part is added to
the end of the list.
@@ -571,7 +594,7 @@ public class PartListBuilder {
* @return This object (for method chaining).
*/
public PartListBuilder setDefault(String name, Object value) {
- return setDefault(part(name, value));
+ return setDefault(createPart(name, value));
}
/**
@@ -582,7 +605,7 @@ public class PartListBuilder {
* @return This object (for method chaining).
*/
public PartListBuilder setDefault(String name, Supplier<?> value) {
- return setDefault(part(name, value));
+ return setDefault(createPart(name, value));
}
/**
@@ -595,7 +618,7 @@ public class PartListBuilder {
* @return This object (for method chaining).
*/
@FluentSetter
- public PartListBuilder setDefault(List<NameValuePair> values) {
+ public PartListBuilder setDefault(List<? extends NameValuePair> values)
{
if (values != null) {
if (defaultEntries == null)
@@ -638,6 +661,209 @@ public class PartListBuilder {
return this;
}
+ /**
+ * Adds the specify part to this list.
+ *
+ * @param flag
+ * What to do with the part.
+ * <br>Possible values:
+ * <ul>
+ * <li>{@link ListOperation#APPEND APPEND} - Calls {@link
#append(NameValuePair)}.
+ * <li>{@link ListOperation#PREPEND PREEND} - Calls {@link
#prepend(NameValuePair)}.
+ * <li>{@link ListOperation#SET REPLACE} - Calls {@link
#set(NameValuePair)}.
+ * <li>{@link ListOperation#DEFAULT DEFAULT} - Calls
{@link #setDefault(NameValuePair)}.
+ * </ul>
+ * @param value The part to add.
+ * @return This object (for method chaining).
+ */
+ @FluentSetter
+ public PartListBuilder add(ListOperation flag, NameValuePair value) {
+ if (flag == ListOperation.APPEND)
+ return append(value);
+ if (flag == ListOperation.PREPEND)
+ return prepend(value);
+ if (flag == ListOperation.SET)
+ return set(value);
+ if (flag == ListOperation.DEFAULT)
+ return setDefault(value);
+ throw runtimeException("Invalid value specified for flag
parameter on add(flag,value) method: {0}", flag);
+ }
+
+ /**
+ * Adds the specified parts to this list.
+ *
+ * @param flag
+ * What to do with the part.
+ * <br>Possible values:
+ * <ul>
+ * <li>{@link ListOperation#APPEND APPEND} - Calls {@link
#append(NameValuePair[])}.
+ * <li>{@link ListOperation#PREPEND PREEND} - Calls {@link
#prepend(NameValuePair[])}.
+ * <li>{@link ListOperation#SET REPLACE} - Calls {@link
#set(NameValuePair[])}.
+ * <li>{@link ListOperation#DEFAULT DEFAULT} - Calls
{@link #setDefault(NameValuePair[])}.
+ * </ul>
+ * @param values The parts to add.
+ * @return This object (for method chaining).
+ */
+ @FluentSetter
+ public PartListBuilder add(ListOperation flag, NameValuePair...values) {
+ if (flag == ListOperation.APPEND)
+ return append(values);
+ if (flag == ListOperation.PREPEND)
+ return prepend(values);
+ if (flag == ListOperation.SET)
+ return set(values);
+ if (flag == ListOperation.DEFAULT)
+ return setDefault(values);
+ throw runtimeException("Invalid value specified for flag
parameter on add(flag,values) method: {0}", flag);
+ }
+
+ /**
+ * Adds the specified part to this list.
+ *
+ * @param flag
+ * What to do with the part.
+ * <br>Possible values:
+ * <ul>
+ * <li>{@link ListOperation#APPEND APPEND} - Calls {@link
#append(String,Object)}.
+ * <li>{@link ListOperation#PREPEND PREEND} - Calls {@link
#prepend(String,Object)}.
+ * <li>{@link ListOperation#SET REPLACE} - Calls {@link
#set(String,Object)}.
+ * <li>{@link ListOperation#DEFAULT DEFAULT} - Calls
{@link #setDefault(String,Object)}.
+ * </ul>
+ * @param name The part name.
+ * @param value The part value.
+ * @return This object (for method chaining).
+ */
+ public PartListBuilder add(ListOperation flag, String name, Object
value) {
+ if (flag == ListOperation.APPEND)
+ return append(name, value);
+ if (flag == ListOperation.PREPEND)
+ return prepend(name, value);
+ if (flag == ListOperation.SET)
+ return set(name, value);
+ if (flag == ListOperation.DEFAULT)
+ return setDefault(name, value);
+ throw runtimeException("Invalid value specified for flag
parameter on add(flag,name,value) method: {0}", flag);
+ }
+
+ /**
+ * Adds the specified part to this list.
+ *
+ * @param flag
+ * What to do with the part.
+ * <br>Possible values:
+ * <ul>
+ * <li>{@link ListOperation#APPEND APPEND} - Calls {@link
#append(String,Supplier)}.
+ * <li>{@link ListOperation#PREPEND PREEND} - Calls {@link
#prepend(String,Supplier)}.
+ * <li>{@link ListOperation#SET REPLACE} - Calls {@link
#set(String,Supplier)}.
+ * <li>{@link ListOperation#DEFAULT DEFAULT} - Calls
{@link #setDefault(String,Supplier)}.
+ * </ul>
+ * @param name The part name.
+ * @param value The part value supplier.
+ * @return This object (for method chaining).
+ */
+ public PartListBuilder add(ListOperation flag, String name, Supplier<?>
value) {
+ if (flag == ListOperation.APPEND)
+ return append(name, value);
+ if (flag == ListOperation.PREPEND)
+ return prepend(name, value);
+ if (flag == ListOperation.SET)
+ return set(name, value);
+ if (flag == ListOperation.DEFAULT)
+ return setDefault(name, value);
+ throw runtimeException("Invalid value specified for flag
parameter on add(flag,name,value) method: {0}", flag);
+ }
+
+ /**
+ * Adds the specified parts to this list.
+ *
+ * @param flag
+ * What to do with the part.
+ * <br>Possible values:
+ * <ul>
+ * <li>{@link ListOperation#APPEND APPEND} - Calls {@link
#append(String,Supplier)}.
+ * <li>{@link ListOperation#PREPEND PREEND} - Calls {@link
#prepend(String,Supplier)}.
+ * <li>{@link ListOperation#SET REPLACE} - Calls {@link
#set(String,Supplier)}.
+ * <li>{@link ListOperation#DEFAULT DEFAULT} - Calls
{@link #setDefault(String,Supplier)}.
+ * </ul>
+ * @param values The parts to add.
+ * @return This object (for method chaining).
+ */
+ @FluentSetter
+ public PartListBuilder add(ListOperation flag, List<NameValuePair>
values) {
+ if (flag == ListOperation.APPEND)
+ return append(values);
+ if (flag == ListOperation.PREPEND)
+ return prepend(values);
+ if (flag == ListOperation.SET)
+ return set(values);
+ if (flag == ListOperation.DEFAULT)
+ return setDefault(values);
+ throw runtimeException("Invalid value specified for flag
parameter on add(flag,values) method: {0}", flag);
+ }
+
+ /**
+ * Adds the specified parts to this list.
+ *
+ * @param flag
+ * What to do with the part.
+ * <br>Possible values:
+ * <ul>
+ * <li>{@link ListOperation#APPEND APPEND} - Calls {@link
#append(PartList)}.
+ * <li>{@link ListOperation#PREPEND PREEND} - Calls {@link
#prepend(PartList)}.
+ * <li>{@link ListOperation#SET REPLACE} - Calls {@link
#set(PartList)}.
+ * <li>{@link ListOperation#DEFAULT DEFAULT} - Calls
{@link #setDefault(PartList)}.
+ * </ul>
+ * @param values The parts to add.
+ * @return This object (for method chaining).
+ */
+ public PartListBuilder add(ListOperation flag, PartList values) {
+ if (flag == ListOperation.APPEND)
+ return append(values);
+ if (flag == ListOperation.PREPEND)
+ return prepend(values);
+ if (flag == ListOperation.SET)
+ return set(values);
+ if (flag == ListOperation.DEFAULT)
+ return setDefault(values);
+ throw runtimeException("Invalid value specified for flag
parameter on add(flag,values) method: {0}", flag);
+ }
+
+ /**
+ * Performs an operation on the parts of this list.
+ *
+ * <p>
+ * This is the preferred method for iterating over parts as it does not
involve
+ * creation or copy of lists/arrays.
+ *
+ * @param c The consumer.
+ * @return This object (for method chaining).
+ */
+ public PartListBuilder forEach(Consumer<NameValuePair> c) {
+ for (int i = 0, j = entries.size(); i < j; i++)
+ c.accept(entries.get(i));
+ return this;
+ }
+
+ /**
+ * Performs an operation on the parts with the specified name in this
list.
+ *
+ * <p>
+ * This is the preferred method for iterating over parts as it does not
involve
+ * creation or copy of lists/arrays.
+ *
+ * @param name The part name.
+ * @param c The consumer.
+ * @return This object (for method chaining).
+ */
+ public PartListBuilder forEach(String name, Consumer<NameValuePair> c) {
+ for (int i = 0, j = entries.size(); i < j; i++) {
+ NameValuePair x = entries.get(i);
+ if (eq(name, x.getName()))
+ c.accept(x);
+ }
+ return this;
+ }
+
private boolean isResolving() {
return varResolver != null;
}
@@ -652,17 +878,25 @@ public class PartListBuilder {
return o;
}
- private NameValuePair part(String name, Object value) {
- return isResolving() ? new BasicPart(name, resolver(value)) :
new BasicPart(name, value);
- }
-
- private NameValuePair part(String name, Supplier<?> value) {
+ /**
+ * Creates a new part out of the specified name/value pair.
+ *
+ * @param name The part name.
+ * @param value The part value.
+ * @return A new header.
+ */
+ public NameValuePair createPart(String name, Object value) {
+ if (value instanceof Supplier<?>) {
+ Supplier<?> value2 = (Supplier<?>)value;
+ return isResolving() ? new BasicPart(name,
resolver(value2)) : new BasicPart(name, value2);
+ }
return isResolving() ? new BasicPart(name, resolver(value)) :
new BasicPart(name, value);
}
private boolean eq(String s1, String s2) {
return caseInsensitive ? StringUtils.eq(s1, s2) :
StringUtils.eqic(s1, s2);
}
+
// <FluentSetters>
// </FluentSetters>
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/Accepted.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/Accepted.java
index daebd52..0d30996 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/Accepted.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/Accepted.java
@@ -17,7 +17,6 @@ import static org.apache.juneau.http.response.Accepted.*;
import org.apache.http.*;
import org.apache.juneau.http.*;
import org.apache.juneau.http.annotation.*;
-import org.apache.juneau.internal.*;
/**
* Represents an <c>HTTP 202 Accepted</c> response.
@@ -27,7 +26,6 @@ import org.apache.juneau.internal.*;
* The request might or might not be eventually acted upon, and may be
disallowed when processing occurs.
*/
@Response(code=STATUS_CODE, description=REASON_PHRASE)
-@FluentSetters
public class Accepted extends BasicHttpResponse {
/** HTTP status code */
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/AlreadyReported.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/AlreadyReported.java
index 2d95b0a..7c73ad9 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/AlreadyReported.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/AlreadyReported.java
@@ -17,7 +17,6 @@ import static
org.apache.juneau.http.response.AlreadyReported.*;
import org.apache.http.*;
import org.apache.juneau.http.*;
import org.apache.juneau.http.annotation.*;
-import org.apache.juneau.internal.*;
/**
* Represents an <c>HTTP 208 Already Reported</c> response.
@@ -26,7 +25,6 @@ import org.apache.juneau.internal.*;
* The members of a DAV binding have already been enumerated in a preceding
part of the (multistatus) response, and are not being included again.
*/
@Response(code=STATUS_CODE, description=REASON_PHRASE)
-@FluentSetters
public class AlreadyReported extends BasicHttpResponse {
/** HTTP status code */
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/Continue.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/Continue.java
index 5ba1d65..e4ae6a3 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/Continue.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/Continue.java
@@ -17,7 +17,6 @@ import static org.apache.juneau.http.response.Continue.*;
import org.apache.http.*;
import org.apache.juneau.http.*;
import org.apache.juneau.http.annotation.*;
-import org.apache.juneau.internal.*;
/**
* Represents an <c>HTTP 100 Continue</c> response.
@@ -30,7 +29,6 @@ import org.apache.juneau.internal.*;
* The response 417 Expectation Failed indicates that the request should be
repeated without the Expect header as it indicates that the server doesn't
support expectations (this is the case, for example, of HTTP/1.0 servers).
*/
@Response(code=STATUS_CODE, description=REASON_PHRASE)
-@FluentSetters
public class Continue extends BasicHttpResponse {
/** HTTP status code */
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/Created.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/Created.java
index 7f09ec1..71be7df 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/Created.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/Created.java
@@ -17,7 +17,6 @@ import static org.apache.juneau.http.response.Created.*;
import org.apache.http.*;
import org.apache.juneau.http.*;
import org.apache.juneau.http.annotation.*;
-import org.apache.juneau.internal.*;
/**
* Represents an <c>HTTP 201 Created</c> response.
@@ -26,7 +25,6 @@ import org.apache.juneau.internal.*;
* The request has been fulfilled, resulting in the creation of a new resource.
*/
@Response(code=STATUS_CODE, description=REASON_PHRASE)
-@FluentSetters
public class Created extends BasicHttpResponse {
/** HTTP status code */
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/EarlyHints.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/EarlyHints.java
index e9b001f..e90ed7b 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/EarlyHints.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/EarlyHints.java
@@ -16,7 +16,6 @@ import static org.apache.juneau.http.response.EarlyHints.*;
import org.apache.juneau.http.*;
import org.apache.juneau.http.annotation.*;
-import org.apache.juneau.internal.*;
/**
* Represents an <c>HTTP 103 Early Hints</c> response.
@@ -25,7 +24,6 @@ import org.apache.juneau.internal.*;
* Used to return some response headers before final HTTP message.
*/
@Response(code=STATUS_CODE, description=REASON_PHRASE)
-@FluentSetters
public class EarlyHints extends BasicHttpResponse {
/** HTTP status code */
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/Found.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/Found.java
index b133600..b6c15b5 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/Found.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/Found.java
@@ -17,7 +17,6 @@ import static org.apache.juneau.http.response.Found.*;
import org.apache.http.*;
import org.apache.juneau.http.*;
import org.apache.juneau.http.annotation.*;
-import org.apache.juneau.internal.*;
/**
* Represents an <c>HTTP 302 Found</c> response.
@@ -30,7 +29,6 @@ import org.apache.juneau.internal.*;
* However, some Web applications and frameworks use the 302 status code as if
it were the 303.
*/
@Response(code=STATUS_CODE, description=REASON_PHRASE)
-@FluentSetters
public class Found extends BasicHttpResponse {
/** HTTP status code */
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/IMUsed.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/IMUsed.java
index 932f23a..8231c9b 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/IMUsed.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/IMUsed.java
@@ -17,7 +17,6 @@ import static org.apache.juneau.http.response.IMUsed.*;
import org.apache.http.*;
import org.apache.juneau.http.*;
import org.apache.juneau.http.annotation.*;
-import org.apache.juneau.internal.*;
/**
* Represents an <c>HTTP 226 IM Used</c> response.
@@ -26,7 +25,6 @@ import org.apache.juneau.internal.*;
* The server has fulfilled a request for the resource, and the response is a
representation of the result of one or more instance-manipulations applied to
the current instance.
*/
@Response(code=STATUS_CODE, description=REASON_PHRASE)
-@FluentSetters
public class IMUsed extends BasicHttpResponse {
/** HTTP status code */
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/MovedPermanently.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/MovedPermanently.java
index fb75934..63e9c2d 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/MovedPermanently.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/MovedPermanently.java
@@ -17,7 +17,6 @@ import static
org.apache.juneau.http.response.MovedPermanently.*;
import org.apache.http.*;
import org.apache.juneau.http.*;
import org.apache.juneau.http.annotation.*;
-import org.apache.juneau.internal.*;
/**
* Represents an <c>HTTP 301 Moved Permanently</c> response.
@@ -26,7 +25,6 @@ import org.apache.juneau.internal.*;
* This and all future requests should be directed to the given URI.
*/
@Response(code=STATUS_CODE, description=REASON_PHRASE)
-@FluentSetters
public class MovedPermanently extends BasicHttpResponse {
/** HTTP status code */
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/MultiStatus.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/MultiStatus.java
index 794bf0d..b54ef63 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/MultiStatus.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/MultiStatus.java
@@ -17,7 +17,6 @@ import static org.apache.juneau.http.response.MultiStatus.*;
import org.apache.http.*;
import org.apache.juneau.http.*;
import org.apache.juneau.http.annotation.*;
-import org.apache.juneau.internal.*;
/**
* Represents an <c>HTTP 207 Multi-Status</c> response.
@@ -26,7 +25,6 @@ import org.apache.juneau.internal.*;
* The message body that follows is by default an XML message and can contain
a number of separate response codes, depending on how many sub-requests were
made.
*/
@Response(code=STATUS_CODE, description=REASON_PHRASE)
-@FluentSetters
public class MultiStatus extends BasicHttpResponse {
/** HTTP status code */
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/MultipleChoices.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/MultipleChoices.java
index 06915fc..63f6a56 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/MultipleChoices.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/MultipleChoices.java
@@ -17,7 +17,6 @@ import static
org.apache.juneau.http.response.MultipleChoices.*;
import org.apache.http.*;
import org.apache.juneau.http.*;
import org.apache.juneau.http.annotation.*;
-import org.apache.juneau.internal.*;
/**
* Represents an <c>HTTP 300 Multiple Choices</c> response.
@@ -27,7 +26,6 @@ import org.apache.juneau.internal.*;
* For example, this code could be used to present multiple video format
options, to list files with different filename extensions, or to suggest
word-sense disambiguation.
*/
@Response(code=STATUS_CODE, description=REASON_PHRASE)
-@FluentSetters
public class MultipleChoices extends BasicHttpResponse {
/** HTTP status code */
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/NoContent.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/NoContent.java
index 95934d2..0664f8a 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/NoContent.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/NoContent.java
@@ -17,7 +17,6 @@ import static org.apache.juneau.http.response.NoContent.*;
import org.apache.http.*;
import org.apache.juneau.http.*;
import org.apache.juneau.http.annotation.*;
-import org.apache.juneau.internal.*;
/**
* Represents an <c>HTTP 204 No Content</c> response.
@@ -26,7 +25,6 @@ import org.apache.juneau.internal.*;
* The server successfully processed the request and is not returning any
content.
*/
@Response(code=STATUS_CODE, description=REASON_PHRASE)
-@FluentSetters
public class NoContent extends BasicHttpResponse {
/** HTTP status code */
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/NonAuthoritiveInformation.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/NonAuthoritiveInformation.java
index c19713f..1df1d66 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/NonAuthoritiveInformation.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/NonAuthoritiveInformation.java
@@ -17,7 +17,6 @@ import static
org.apache.juneau.http.response.NonAuthoritiveInformation.*;
import org.apache.http.*;
import org.apache.juneau.http.*;
import org.apache.juneau.http.annotation.*;
-import org.apache.juneau.internal.*;
/**
* Represents an <c>HTTP 203 Non-Authoritative Information</c> response.
@@ -26,7 +25,6 @@ import org.apache.juneau.internal.*;
* The server is a transforming proxy (e.g. a Web accelerator) that received a
200 OK from its origin, but is returning a modified version of the origin's
response.
*/
@Response(code=STATUS_CODE, description=REASON_PHRASE)
-@FluentSetters
public class NonAuthoritiveInformation extends BasicHttpResponse {
/** HTTP status code */
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/NotModified.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/NotModified.java
index 9172d69..7687f35 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/NotModified.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/NotModified.java
@@ -17,7 +17,6 @@ import static org.apache.juneau.http.response.NotModified.*;
import org.apache.http.*;
import org.apache.juneau.http.*;
import org.apache.juneau.http.annotation.*;
-import org.apache.juneau.internal.*;
/**
* Represents an <c>HTTP 304 Not Modified</c> response.
@@ -27,7 +26,6 @@ import org.apache.juneau.internal.*;
* In such case, there is no need to retransmit the resource since the client
still has a previously-downloaded copy.
*/
@Response(code=STATUS_CODE, description=REASON_PHRASE)
-@FluentSetters
public class NotModified extends BasicHttpResponse {
/** HTTP status code */
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/Ok.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/Ok.java
index 68c07c5..78a2e07 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/Ok.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/Ok.java
@@ -17,7 +17,6 @@ import static org.apache.juneau.http.response.Ok.*;
import org.apache.http.*;
import org.apache.juneau.http.*;
import org.apache.juneau.http.annotation.*;
-import org.apache.juneau.internal.*;
/**
* Represents an <c>HTTP 200 OK</c> response.
@@ -28,7 +27,6 @@ import org.apache.juneau.internal.*;
* In a POST request, the response will contain an entity describing or
containing the result of the action.
*/
@Response(code=STATUS_CODE, description=REASON_PHRASE)
-@FluentSetters
public class Ok extends BasicHttpResponse {
/** HTTP status code */
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/PartialContent.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/PartialContent.java
index f218d35..7966b29 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/PartialContent.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/PartialContent.java
@@ -17,7 +17,6 @@ import static
org.apache.juneau.http.response.PartialContent.*;
import org.apache.http.*;
import org.apache.juneau.http.*;
import org.apache.juneau.http.annotation.*;
-import org.apache.juneau.internal.*;
/**
* Represents an <c>HTTP 206 Partial Content</c> response.
@@ -27,7 +26,6 @@ import org.apache.juneau.internal.*;
* The range header is used by HTTP clients to enable resuming of interrupted
downloads, or split a download into multiple simultaneous streams.
*/
@Response(code=STATUS_CODE, description=REASON_PHRASE)
-@FluentSetters
public class PartialContent extends BasicHttpResponse {
/** HTTP status code */
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/PermanentRedirect.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/PermanentRedirect.java
index af34982..221eb47 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/PermanentRedirect.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/PermanentRedirect.java
@@ -17,7 +17,6 @@ import static
org.apache.juneau.http.response.PermanentRedirect.*;
import org.apache.http.*;
import org.apache.juneau.http.*;
import org.apache.juneau.http.annotation.*;
-import org.apache.juneau.internal.*;
/**
* Represents an <c>HTTP 308 Permanent Redirect</c> response.
@@ -27,7 +26,6 @@ import org.apache.juneau.internal.*;
* So, for example, submitting a form to a permanently redirected resource may
continue smoothly.
*/
@Response(code=STATUS_CODE, description=REASON_PHRASE)
-@FluentSetters
public class PermanentRedirect extends BasicHttpResponse {
/** HTTP status code */
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/Processing.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/Processing.java
index 92414c6..1ab7bf7 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/Processing.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/Processing.java
@@ -17,7 +17,6 @@ import static org.apache.juneau.http.response.Processing.*;
import org.apache.http.*;
import org.apache.juneau.http.*;
import org.apache.juneau.http.annotation.*;
-import org.apache.juneau.internal.*;
/**
* Represents an <c>HTTP 102 Processing</c> response.
@@ -28,7 +27,6 @@ import org.apache.juneau.internal.*;
* This prevents the client from timing out and assuming the request was lost.
*/
@Response(code=STATUS_CODE, description=REASON_PHRASE)
-@FluentSetters
public class Processing extends BasicHttpResponse {
/** HTTP status code */
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/ResetContent.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/ResetContent.java
index dc12f8d..5902e18 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/ResetContent.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/ResetContent.java
@@ -17,7 +17,6 @@ import static org.apache.juneau.http.response.ResetContent.*;
import org.apache.http.*;
import org.apache.juneau.http.*;
import org.apache.juneau.http.annotation.*;
-import org.apache.juneau.internal.*;
/**
* Represents an <c>HTTP 205 Reset Content</c> response.
@@ -27,7 +26,6 @@ import org.apache.juneau.internal.*;
* Unlike a 204 response, this response requires that the requester reset the
document view.
*/
@Response(code=STATUS_CODE, description=REASON_PHRASE)
-@FluentSetters
public class ResetContent extends BasicHttpResponse {
/** HTTP status code */
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/SeeOther.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/SeeOther.java
index 8e608c5..61203c1 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/SeeOther.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/SeeOther.java
@@ -17,7 +17,6 @@ import static org.apache.juneau.http.response.SeeOther.*;
import org.apache.http.*;
import org.apache.juneau.http.*;
import org.apache.juneau.http.annotation.*;
-import org.apache.juneau.internal.*;
/**
* Represents an <c>HTTP 303 See Other</c> response.
@@ -27,7 +26,6 @@ import org.apache.juneau.internal.*;
* When received in response to a POST (or PUT/DELETE), the client should
presume that the server has received the data and should issue a new GET
request to the given URI.
*/
@Response(code=STATUS_CODE, description=REASON_PHRASE)
-@FluentSetters
public class SeeOther extends BasicHttpResponse {
/** HTTP status code */
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/SwitchingProtocols.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/SwitchingProtocols.java
index b635ef8..af05fad 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/SwitchingProtocols.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/SwitchingProtocols.java
@@ -17,7 +17,6 @@ import static
org.apache.juneau.http.response.SwitchingProtocols.*;
import org.apache.http.*;
import org.apache.juneau.http.*;
import org.apache.juneau.http.annotation.*;
-import org.apache.juneau.internal.*;
/**
* Represents an <c>HTTP 101 Switching Protocols</c> response.
@@ -26,7 +25,6 @@ import org.apache.juneau.internal.*;
* The requester has asked the server to switch protocols and the server has
agreed to do so.
*/
@Response(code=STATUS_CODE, description=REASON_PHRASE)
-@FluentSetters
public class SwitchingProtocols extends BasicHttpResponse {
/** HTTP status code */
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/TemporaryRedirect.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/TemporaryRedirect.java
index d238952..acc9eb5 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/TemporaryRedirect.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/TemporaryRedirect.java
@@ -17,7 +17,6 @@ import static
org.apache.juneau.http.response.TemporaryRedirect.*;
import org.apache.http.*;
import org.apache.juneau.http.*;
import org.apache.juneau.http.annotation.*;
-import org.apache.juneau.internal.*;
/**
* Represents an <c>HTTP 307 Temporary Redirect</c> response.
@@ -28,7 +27,6 @@ import org.apache.juneau.internal.*;
* For example, a POST request should be repeated using another POST request.
*/
@Response(code=STATUS_CODE, description=REASON_PHRASE)
-@FluentSetters
public class TemporaryRedirect extends BasicHttpResponse {
/** HTTP status code */
diff --git
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/UseProxy.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/UseProxy.java
index 335976f..9e9711d 100644
---
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/UseProxy.java
+++
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/response/UseProxy.java
@@ -17,7 +17,6 @@ import static org.apache.juneau.http.response.UseProxy.*;
import org.apache.http.*;
import org.apache.juneau.http.*;
import org.apache.juneau.http.annotation.*;
-import org.apache.juneau.internal.*;
/**
* Represents an <c>HTTP 305 Use Proxy</c> response.
@@ -27,7 +26,6 @@ import org.apache.juneau.internal.*;
* Many HTTP clients (such as Mozilla and Internet Explorer) do not correctly
handle responses with this status code, primarily for security reasons.
*/
@Response(code=STATUS_CODE, description=REASON_PHRASE)
-@FluentSetters
public class UseProxy extends BasicHttpResponse {
/** HTTP status code */