All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.rx.net.http.cookie.VolatileCookieStorage Maven / Gradle / Ivy

There is a newer version: 3.0.0
Show newest version
package org.rx.net.http.cookie;

import okhttp3.Cookie;
import org.rx.core.Linq;

import java.util.Collection;
import java.util.Iterator;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

public class VolatileCookieStorage implements Iterable {
    final Set store = ConcurrentHashMap.newKeySet();

    public void addAll(Collection newCookies) {
        store.addAll(IdentifiableCookie.decorateAll(newCookies));
    }

    public void clear() {
        store.clear();
    }

    @Override
    public Iterator iterator() {
        return Linq.from(store).select(p -> p.cookie).iterator();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy