Fix binary backwards incompatibility with 1.0
svn path=/trunk/; revision=571
diff --git a/src/jsr311-api/src/javax/ws/rs/core/Response.java b/src/jsr311-api/src/javax/ws/rs/core/Response.java
index 0dd8056..7db4640 100644
--- a/src/jsr311-api/src/javax/ws/rs/core/Response.java
+++ b/src/jsr311-api/src/javax/ws/rs/core/Response.java
@@ -110,6 +110,16 @@
* Create a new ResponseBuilder with the supplied status.
* @param status the response status
* @return a new ResponseBuilder
+ * @throws IllegalArgumentException if status is null
+ */
+ public static ResponseBuilder status(Status status) {
+ return status((StatusType)status);
+ }
+
+ /**
+ * Create a new ResponseBuilder with the supplied status.
+ * @param status the response status
+ * @return a new ResponseBuilder
* @throws IllegalArgumentException if status is less than 100 or greater
* than 599.
*/
@@ -386,6 +396,17 @@
};
/**
+ * Set the status on the ResponseBuilder.
+ *
+ * @param status the response status
+ * @return the updated ResponseBuilder
+ * @throws IllegalArgumentException if status is null
+ */
+ public ResponseBuilder status(Status status) {
+ return status((StatusType)status);
+ };
+
+ /**
* Set the entity on the ResponseBuilder. It is the
* callers responsibility to wrap the actual entity with
* {@link GenericEntity} if preservation of its generic type is required.
@@ -553,12 +574,6 @@
*/
public interface StatusType {
/**
- * An enumeration representing the class of status code. Family is used
- * here since class is overloaded in Java.
- */
- public enum Family {INFORMATIONAL, SUCCESSFUL, REDIRECTION, CLIENT_ERROR, SERVER_ERROR, OTHER};
-
- /**
* Get the associated status code
* @return the status code
*/
@@ -568,7 +583,7 @@
* Get the class of status code
* @return the class of status code
*/
- public Family getFamily();
+ public Status.Family getFamily();
/**
* Get the reason phrase
@@ -665,6 +680,12 @@
private final String reason;
private Family family;
+ /**
+ * An enumeration representing the class of status code. Family is used
+ * here since class is overloaded in Java.
+ */
+ public enum Family {INFORMATIONAL, SUCCESSFUL, REDIRECTION, CLIENT_ERROR, SERVER_ERROR, OTHER};
+
Status(final int statusCode, final String reasonPhrase) {
this.code = statusCode;
this.reason = reasonPhrase;