T
- the type of the raw datapublic class CsvResponse<T> extends AbstractResponse<T>
entries, objectMappers, pages, uriInfo
Constructor and Description |
---|
CsvResponse(Stream<T> entries,
Pagination<?> pages,
javax.ws.rs.core.UriInfo uriInfo,
List<String> columnNames,
ObjectMappersSuite objectMappers)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
write(OutputStream os)
Writes CSV response.
|
addLink, addLink, addLink, addLinks, addLinks, getResponseStream, writeMetaObject
public CsvResponse(Stream<T> entries, Pagination<?> pages, javax.ws.rs.core.UriInfo uriInfo, List<String> columnNames, ObjectMappersSuite objectMappers)
entries
- The data entries to generate the response for.pages
- The paginated set of results containing the pages being linked to.uriInfo
- UriInfo to generate the URL for the page links.columnNames
- The CSV header. If null this class will try to extract the header given that the entries
represent maps with strings as keys.objectMappers
- Suite of Object Mappers to use when serializing the response.public void write(OutputStream os) throws IOException
write
in class AbstractResponse<T>
os
- The output stream to write document bytes toIOException
- If an error occurs while writing this streamCopyright © 2016–2018 Yahoo! Inc.. All rights reserved.