hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1049192 - in /httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params: AbstractHttpParams.java DefaultedHttpParams.java
Date Tue, 14 Dec 2010 17:42:11 GMT
Author: sebb
Date: Tue Dec 14 17:42:10 2010
New Revision: 1049192

URL: http://svn.apache.org/viewvc?rev=1049192&view=rev
Log:
Add entrySet() to abstract parent class and other existing implementation

Modified:
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/AbstractHttpParams.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/DefaultedHttpParams.java

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/AbstractHttpParams.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/AbstractHttpParams.java?rev=1049192&r1=1049191&r2=1049192&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/AbstractHttpParams.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/AbstractHttpParams.java
Tue Dec 14 17:42:10 2010
@@ -27,6 +27,8 @@
 
 package org.apache.http.params;
 
+import java.util.Set;
+
 import org.apache.http.params.HttpParams;
 
 
@@ -106,4 +108,13 @@ public abstract class AbstractHttpParams
         return !getBooleanParameter(name, false);
     }
 
+
+    /**
+     * Provide access to the set of parameters as Map.Entry elements.
+     * 
+     * @return the Set of Map.Entry<String, Object> elements
+     * @since 4.1.1
+     */
+    public abstract Set entrySet();
+
 } // class AbstractHttpParams

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/DefaultedHttpParams.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/DefaultedHttpParams.java?rev=1049192&r1=1049191&r2=1049192&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/DefaultedHttpParams.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/DefaultedHttpParams.java
Tue Dec 14 17:42:10 2010
@@ -27,6 +27,8 @@
 
 package org.apache.http.params;
 
+import java.util.Set;
+
 import org.apache.http.params.HttpParams;
 
 /**
@@ -42,6 +44,12 @@ public final class DefaultedHttpParams e
     private final HttpParams local;
     private final HttpParams defaults;
 
+    /**
+     * Create the defaulted set of HttpParams.
+     * 
+     * @param local the mutable set of HttpParams
+     * @param defaults the default set of HttpParams, not mutated by this class
+     */
     public DefaultedHttpParams(final HttpParams local, final HttpParams defaults) {
         super();
         if (local == null) {
@@ -90,8 +98,24 @@ public final class DefaultedHttpParams e
         return this.local.setParameter(name, value);
     }
 
+    /**
+     * 
+     * @return the default HttpParams collection
+     */
     public HttpParams getDefaults() {
         return this.defaults;
     }
 
+    /**
+     * Provide access to the set of local parameters as Map.Entry elements.
+     * To get the entrySet for the default parameters,
+     * use {@code ((AbstractHttpParams) getDefaults()).entrySet()}
+     * @return the Set of Map.Entry<String, Object> elements
+     * @since 4.1.1
+     * @throws ClassCastException if local parameters cannot be cast to AbstractHttpParams
+     */
+    public Set entrySet() {
+        return ((AbstractHttpParams) local).entrySet();
+    }
+
 }



Mime
View raw message