src/main/java/org/trellisldp/http/impl/RdfUtils.java
/**
     * Create a filter based on a Prefer header
     * @param prefer the Prefer header
     * @return a suitable predicate for filtering a stream of quads
     */
Create a filter based on a Prefer header
@param prefer the Prefer header
@return a suitable predicate for filtering a stream of quads
Create a filter based on a Prefer header @param prefer the Prefer header @return a suitable predicate for filtering a stream of quads
public static Predicate<Quad> filterWithPrefer(final Prefer prefer) {
        final Set<String> include = new HashSet<>(DEFAULT_REPRESENTATION);
        ofNullable(prefer).ifPresent(p -> {
            p.getOmit().forEach(include::remove);
            p.getInclude().forEach(include::add);
        });
        return quad -> quad.getGraphName().filter(x -> x instanceof IRI).map(x -> (IRI) x)
            .map(IRI::getIRIString).filter(include::contains).isPresent();
    }
public static Predicate < Quad > filterWithPrefer ( final Prefer prefer ) { final Set < String > include = new HashSet < > ( DEFAULT_REPRESENTATION ) ; ofNullable ( prefer ) . ifPresent ( p -> { p . getOmit ( ) . forEach ( include :: remove ) ; p . getInclude ( ) . forEach ( include :: add ) ; } ) ; return quad -> quad . getGraphName ( ) . filter ( x -> x instanceof IRI ) . map ( x -> ( IRI ) x ) . map ( IRI :: getIRIString ) . filter ( include :: contains ) . isPresent ( ) ; }
Create a filter based on a Prefer header
 @param prefer the Prefer header
 @return a suitable predicate for filtering a stream of quads
Create a filter based on a Prefer header @param prefer the Prefer header @return a suitable predicate for filtering a stream of quads