Package org.apache.http.cookie
Class CookieIdentityComparator
java.lang.Object
org.apache.http.cookie.CookieIdentityComparator
- All Implemented Interfaces:
Serializable,Comparator<Cookie>
public class CookieIdentityComparator extends Object implements Serializable, Comparator<Cookie>
This cookie comparator can be used to compare identity of cookies.
Cookies are considered identical if their names are equal and their domain attributes match ignoring case.
- Author:
- Oleg Kalnichevski
- See Also:
- Serialized Form
-
Constructor Details
-
CookieIdentityComparator
public CookieIdentityComparator()
-
-
Method Details
-
compare
Description copied from interface:ComparatorCompares the two specified objects to determine their relative ordering. The ordering implied by the return value of this method for all possible pairs of(lhs, rhs)should form an equivalence relation. This means thatcompare(a,a)returns zero for alla- the sign of
compare(a,b)must be the opposite of the sign ofcompare(b,a)for all pairs of (a,b) - From
compare(a,b) > 0andcompare(b,c) > 0it must followcompare(a,c) > 0for all possible combinations of(a,b,c)
- Specified by:
comparein interfaceComparator<Cookie>- Parameters:
c1- anObject.c2- a secondObjectto compare withlhs.- Returns:
- an integer < 0 if
lhsis less thanrhs, 0 if they are equal, and > 0 iflhsis greater thanrhs.
-