Interface ApiResponse
- All Known Implementing Classes:
ErrorResponse,ImageSearchApiResponse,NewsSearchApiResponse,SpellcheckSearchApiResponse,SuggestSearchApiResponse,VideoSearchApiResponse,WebSearchApiResponse
public sealed interface ApiResponse
permits WebSearchApiResponse, ErrorResponse, ImageSearchApiResponse, NewsSearchApiResponse, SpellcheckSearchApiResponse, VideoSearchApiResponse, SuggestSearchApiResponse
This marker interface represents the API response objects from the Brave Search API. Implementing
classes are meant to be deserialised and served as Plain Old Java Objects (POJOs).
-
Method Summary
-
Method Details
-
toJson
String toJson()Serializes the response object to a JSON string.- Returns:
- a JSON string representation of the response object.
-
write
Writes the response object to a file on the filesystem.- Parameters:
file- the file to write the response object to.
-