public class FiliResponseWriterSelector extends Object implements ResponseWriterSelector
Constructor and Description |
---|
FiliResponseWriterSelector(CsvResponseWriter csvResponseWriter,
JsonResponseWriter jsonResponseWriter,
JsonApiResponseWriter jsonApiResponseWriter)
Constructor for default writer selector.
|
Modifier and Type | Method and Description |
---|---|
void |
addWriter(ResponseFormatType type,
ResponseWriter writer)
Add a customized format writer pair to the Map.
|
Optional<ResponseWriter> |
select(ApiRequest request)
Selects a ResponseWriter given the format type from request.
|
public FiliResponseWriterSelector(CsvResponseWriter csvResponseWriter, JsonResponseWriter jsonResponseWriter, JsonApiResponseWriter jsonApiResponseWriter)
csvResponseWriter
- The CSV writer which serialize output into csv formatjsonResponseWriter
- The Json writer which serialize output into csv formatjsonApiResponseWriter
- The JsonApi writer which serialize output into csv formatpublic Optional<ResponseWriter> select(ApiRequest request)
select
in interface ResponseWriterSelector
request
- ApiRequest object with all the associated info in itpublic void addWriter(ResponseFormatType type, ResponseWriter writer)
type
- Custom format type.writer
- Writer which should be used to do serialization with the type.Copyright © 2016–2018 Yahoo! Inc.. All rights reserved.