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> var1) {
      this.a = var1;
   }

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

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

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