package dev.dinauer.maven.shared;

import com.fasterxml.jackson.annotation.JsonIgnore;

import java.util.Collection;
import java.util.Set;
import java.util.stream.Collectors;

public interface UserReferencing
{
    @JsonIgnore
    Set<String> getUserIds();

    static Set<String> collect(Collection<? extends UserReferencing> items)
    {
        return items.stream().flatMap(item -> item.getUserIds().stream()).collect(Collectors.toSet());
    }
}