001/*
002 * The contents of this file are subject to the license and copyright
003 * detailed in the LICENSE and NOTICE files at the root of the source
004 * tree.
005 */
006package org.fcrepo.http.commons.domain;
007
008import java.util.Set;
009
010import javax.ws.rs.HeaderParam;
011
012/**
013 * Aggregates information from multiple Prefer HTTP headers.
014 *
015 * @author ajs6f
016 * @since 23 October 2014
017 */
018public class MultiPrefer extends SinglePrefer {
019
020    /**
021     * @param header the header
022     */
023    public MultiPrefer(final String header) {
024        super(header);
025    }
026
027    /**
028     * @param prefers the prefers
029     */
030    public MultiPrefer(final @HeaderParam("Prefer") Set<SinglePrefer> prefers) {
031        super("");
032        prefers.forEach(p -> preferTags().addAll(p.preferTags()));
033    }
034}