Package masecla.modrinth4j.endpoints
Class SearchEndpoint
public class SearchEndpoint
extends PaginatedEndpoint<SearchEndpoint.SearchResult,SearchEndpoint.SearchResponse,SearchEndpoint.SearchRequest>
Represents the search endpoint.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe IndexType to sort the results by.static classRepresents a search request.static classRepresents a search response.static classRepresents a search result.Nested classes/interfaces inherited from class masecla.modrinth4j.endpoints.generic.PaginatedEndpoint
PaginatedEndpoint.PaginatedRequest, PaginatedEndpoint.PaginatedResponse<T> -
Constructor Summary
ConstructorsConstructorDescriptionSearchEndpoint(HttpClient client, com.google.gson.Gson gson) Creates a new search endpoint. -
Method Summary
Modifier and TypeMethodDescriptionReturns the endpoint to use.com.google.gson.reflect.TypeToken<SearchEndpoint.SearchRequest> Returns the request class to use.com.google.gson.reflect.TypeToken<SearchEndpoint.SearchResponse> Returns the response class to use.booleanIf this endpoint uses a JSON body.Methods inherited from class masecla.modrinth4j.endpoints.generic.Endpoint
checkBodyForErrors, executeRequest, getMethod, getReplacedUrl, readFile, readStream, requiresBody, sendRequest, sendRequest
-
Constructor Details
-
SearchEndpoint
Creates a new search endpoint.- Parameters:
client- - The client to usegson- - The gson instance to use
-
-
Method Details
-
getEndpoint
Returns the endpoint to use.- Specified by:
getEndpointin classEndpoint<SearchEndpoint.SearchResponse,SearchEndpoint.SearchRequest> - Returns:
- - The endpoint of the request.
-
getRequestClass
Returns the request class to use.- Specified by:
getRequestClassin classEndpoint<SearchEndpoint.SearchResponse,SearchEndpoint.SearchRequest> - Returns:
- - The
TypeTokenof the request.
-
getResponseClass
Returns the response class to use.- Specified by:
getResponseClassin classEndpoint<SearchEndpoint.SearchResponse,SearchEndpoint.SearchRequest> - Returns:
- - The
TypeTokenof the response.
-
isJsonBody
public boolean isJsonBody()If this endpoint uses a JSON body.- Overrides:
isJsonBodyin classEndpoint<SearchEndpoint.SearchResponse,SearchEndpoint.SearchRequest> - Returns:
- - Whether or not the request body should be JSON.
-