hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r158958 - in jakarta/httpclient/trunk/http-common/src/java/org/apache/http: impl/DefaultHttpParams.java params/HttpParams.java
Date Thu, 24 Mar 2005 22:18:20 GMT
Author: olegk
Date: Thu Mar 24 14:18:19 2005
New Revision: 158958

URL: http://svn.apache.org/viewcvs?view=rev&rev=158958
Log:
Allow for chaining of parameter setters

Modified:
    jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/DefaultHttpParams.java
    jakarta/httpclient/trunk/http-common/src/java/org/apache/http/params/HttpParams.java

Modified: jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/DefaultHttpParams.java
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/DefaultHttpParams.java?view=diff&r1=158957&r2=158958
==============================================================================
--- jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/DefaultHttpParams.java
(original)
+++ jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/DefaultHttpParams.java
Thu Mar 24 14:18:19 2005
@@ -97,11 +97,12 @@
         }
     }
 
-    public synchronized void setParameter(final String name, final Object value) {
+    public synchronized HttpParams setParameter(final String name, final Object value) {
         if (this.parameters == null) {
             this.parameters = new HashMap();
         }
         this.parameters.put(name, value);
+        return this;
     }
     
     /**
@@ -124,8 +125,9 @@
         return ((Long)param).longValue();
     }
     
-    public void setLongParameter(final String name, long value) {
+    public HttpParams setLongParameter(final String name, long value) {
         setParameter(name, new Long(value));
+        return this;
     }
 
     public int getIntParameter(final String name, int defaultValue) { 
@@ -136,8 +138,9 @@
         return ((Integer)param).intValue();
     }
     
-    public void setIntParameter(final String name, int value) {
+    public HttpParams setIntParameter(final String name, int value) {
         setParameter(name, new Integer(value));
+        return this;
     }
 
     public double getDoubleParameter(final String name, double defaultValue) { 
@@ -148,8 +151,9 @@
         return ((Double)param).doubleValue();
     }
     
-    public void setDoubleParameter(final String name, double value) {
+    public HttpParams setDoubleParameter(final String name, double value) {
         setParameter(name, new Double(value));
+        return this;
     }
 
     public boolean getBooleanParameter(final String name, boolean defaultValue) { 
@@ -160,8 +164,9 @@
         return ((Boolean)param).booleanValue();
     }
     
-    public void setBooleanParameter(final String name, boolean value) {
+    public HttpParams setBooleanParameter(final String name, boolean value) {
         setParameter(name, new Boolean(value));
+        return this;
     }
 
     public boolean isParameterSet(final String name) {

Modified: jakarta/httpclient/trunk/http-common/src/java/org/apache/http/params/HttpParams.java
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/http-common/src/java/org/apache/http/params/HttpParams.java?view=diff&r1=158957&r2=158958
==============================================================================
--- jakarta/httpclient/trunk/http-common/src/java/org/apache/http/params/HttpParams.java (original)
+++ jakarta/httpclient/trunk/http-common/src/java/org/apache/http/params/HttpParams.java Thu
Mar 24 14:18:19 2005
@@ -88,7 +88,7 @@
      * @param name parameter name
      * @param value parameter value
      */ 
-    void setParameter(String name, Object value);
+    HttpParams setParameter(String name, Object value);
     
     /** 
      * Returns a {@link Long} parameter value with the given name. 
@@ -112,7 +112,7 @@
      * @param name parameter name
      * @param value parameter value
      */ 
-    void setLongParameter(String name, long value);
+    HttpParams setLongParameter(String name, long value);
 
     /** 
      * Returns an {@link Integer} parameter value with the given name. 
@@ -136,7 +136,7 @@
      * @param name parameter name
      * @param value parameter value
      */ 
-    void setIntParameter(String name, int value);
+    HttpParams setIntParameter(String name, int value);
 
     /** 
      * Returns a {@link Double} parameter value with the given name. 
@@ -160,7 +160,7 @@
      * @param name parameter name
      * @param value parameter value
      */ 
-    void setDoubleParameter(String name, double value);
+    HttpParams setDoubleParameter(String name, double value);
 
     /** 
      * Returns a {@link Boolean} parameter value with the given name. 
@@ -184,7 +184,7 @@
      * @param name parameter name
      * @param value parameter value
      */ 
-    void setBooleanParameter(String name, boolean value);
+    HttpParams setBooleanParameter(String name, boolean value);
 
     /**
      * Returns <tt>true</tt> if the parameter is set at any level, <tt>false</tt>
otherwise.



Mime
View raw message