Package net.dzultra.jsa.catalogs
Klasse Catalog
java.lang.Object
net.dzultra.jsa.catalogs.Catalog
Represents a Scryfall catalog request and its resulting response.
A catalog is a predefined dataset provided by the Scryfall API, such as card names, types, or keyword lists. This class performs the HTTP request immediately upon construction and stores the raw response for later processing.
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungprotected final ScryfallClientThe Scryfall client used to perform HTTP requests.protected com.google.gson.GsonGson instance used for JSON deserialization.final URIThe full URI used to fetch this catalog. -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungCatalog(ScryfallClient client, CatalogType catalogType) Creates and executes a catalog request immediately. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungParses the catalog response into a structuredCatalogResponse.Returns the type of catalog that was requested.Returns the raw JSON response from the catalog request.
-
Felddetails
-
gson
protected com.google.gson.Gson gsonGson instance used for JSON deserialization. -
client
The Scryfall client used to perform HTTP requests. -
uri
The full URI used to fetch this catalog.
-
-
Konstruktordetails
-
Catalog
Creates and executes a catalog request immediately.The request is sent during construction, and the response is stored internally. If the request fails, a
CatalogResponseExceptionis thrown.- Parameter:
client- the Scryfall client used for HTTP communicationcatalogType- the type of catalog to request- Löst aus:
CatalogResponseException- if the request fails or cannot be completed
-
-
Methodendetails
-
getResponse
Returns the raw JSON response from the catalog request.- Gibt zurück:
- the API response as a JSON string
-
getCatalog
Parses the catalog response into a structuredCatalogResponse.Validates the response before deserialization to ensure it matches the expected catalog format.
- Gibt zurück:
- the parsed
CatalogResponse - Löst aus:
CatalogResponseException- if the response is invalid or cannot be parsed
-
getCatalogType
Returns the type of catalog that was requested.- Gibt zurück:
- the
CatalogTypeassociated with this request
-