/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.gateway.common.service.PublishedService
 *  com.l7tech.objectmodel.Goid
 */
package com.l7tech.server.service.resolution;

import com.l7tech.gateway.common.service.PublishedService;
import com.l7tech.objectmodel.Goid;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;

public class ServiceResolutionHelper {
    private final Map<Goid, PublishedService> a;

    public ServiceResolutionHelper(Map<Goid, PublishedService> map) {
        this.a = map;
    }

    public Collection<PublishedService> allServices() {
        return Collections.unmodifiableCollection(this.a.values());
    }

    public Set<PublishedService> narrowList(List<Goid> list) {
        return list.stream().map(this.a::get).filter(Objects::nonNull).collect(Collectors.toSet());
    }

    public boolean anyMatch(List<Goid> list) {
        return list.stream().anyMatch(this.a::containsKey);
    }
}

