Package net.dzultra.jsa.cards
Klasse CardRequester
java.lang.Object
net.dzultra.jsa.cards.CardRequester
High-level service for querying Magic: The Gathering card data from the Scryfall API.
This class provides multiple convenience methods for retrieving cards by search query,
name lookup, set information, autocomplete suggestions, random cards, and identifiers.
It delegates request execution and response parsing to CardSearchExecutor.
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungfinal ScryfallClientThe Scryfall client used for HTTP communication.protected com.google.gson.GsonGson instance used for JSON deserialization. -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibunggetCardById(String id, CardIDType idType) Retrieves a card by its unique identifier.getCardByName(@NotNull String name, @Nullable String set, boolean fuzzy) Retrieves a single card by name using exact or fuzzy matching.getCardByName(@NotNull String name, @Nullable MTGSet set, boolean fuzzy) Retrieves a single card by name with optional set filtering.getCardBySetAndNumber(String setCode, String collectorNumber) Retrieves a card by set code and collector number.getCardBySetAndNumber(String setCode, String collectorNumber, Language lang) Retrieves a localized card by set, collector number, and language.getCardBySetAndNumber(MTGSet set, String collectorNumber) Retrieves a card by set object and collector number.getCardBySetAndNumber(MTGSet set, String collectorNumber, Language lang) Retrieves a localized card by set object, collector number, and language.getCardNamesByQuery(String query) Retrieves card name suggestions based on a partial query.getCardNamesByQuery(String query, boolean includeExtras) Retrieves card name suggestions with optional extra results included.getCardsByQuery(String query) Searches for cards using a Scryfall query string.getCardsByQuery(String query, @Nullable UniqueMode uniqueMode, @Nullable OrderMode orderMode, @Nullable SortMode sortMode) Searches for cards using a query string with additional search options.Retrieves a completely random card.getRandomCard(String query) Retrieves a random card matching a search query.
-
Felddetails
-
gson
protected com.google.gson.Gson gsonGson instance used for JSON deserialization. -
client
The Scryfall client used for HTTP communication.
-
-
Konstruktordetails
-
CardRequester
Constructs a newCardRequester.- Parameter:
client- the Scryfall client used for API requests
-
-
Methodendetails
-
getCardsByQuery
Searches for cards using a Scryfall query string.- Parameter:
query- the search query (Scryfall syntax)- Gibt zurück:
- a
CardListcontaining matching cards
-
getCardsByQuery
public CardList getCardsByQuery(String query, @Nullable @Nullable UniqueMode uniqueMode, @Nullable @Nullable OrderMode orderMode, @Nullable @Nullable SortMode sortMode) Searches for cards using a query string with additional search options.- Parameter:
query- the search query (Scryfall syntax)uniqueMode- optional uniqueness filtering modeorderMode- optional ordering modesortMode- optional sort direction- Gibt zurück:
- a
CardListcontaining matching cards
-
getCardByName
public Card getCardByName(@NotNull @NotNull String name, @Nullable @Nullable String set, boolean fuzzy) Retrieves a single card by name using exact or fuzzy matching.- Parameter:
name- the card nameset- optional set code restriction; may benullfuzzy- whether to use fuzzy matching instead of exact matching- Gibt zurück:
- the matching
Card
-
getCardByName
public Card getCardByName(@NotNull @NotNull String name, @Nullable @Nullable MTGSet set, boolean fuzzy) Retrieves a single card by name with optional set filtering.- Parameter:
name- the card nameset- optional MTG set; may benullfuzzy- whether to use fuzzy matching instead of exact matching- Gibt zurück:
- the matching
Card
-
getCardNamesByQuery
Retrieves card name suggestions based on a partial query.- Parameter:
query- partial card name input- Gibt zurück:
- a
CardNameListcontaining matching suggestions
-
getCardNamesByQuery
Retrieves card name suggestions with optional extra results included.- Parameter:
query- partial card name inputincludeExtras- whether to include additional non-standard results- Gibt zurück:
- a
CardNameListcontaining matching suggestions
-
getRandomCard
Retrieves a completely random card.- Gibt zurück:
- a random
Card
-
getRandomCard
Retrieves a random card matching a search query.- Parameter:
query- optional search query filter (Scryfall syntax); may benullor empty for no filtering- Gibt zurück:
- a random matching
Card
-
getCardBySetAndNumber
Retrieves a card by set code and collector number.- Parameter:
setCode- the set codecollectorNumber- the collector number within the set- Gibt zurück:
- the matching
Card
-
getCardBySetAndNumber
Retrieves a localized card by set, collector number, and language.- Parameter:
setCode- the set codecollectorNumber- the collector numberlang- the card language- Gibt zurück:
- the matching
Card
-
getCardBySetAndNumber
Retrieves a card by set object and collector number.- Parameter:
set- the MTG setcollectorNumber- the collector number- Gibt zurück:
- the matching
Card
-
getCardBySetAndNumber
Retrieves a localized card by set object, collector number, and language.- Parameter:
set- the MTG setcollectorNumber- the collector numberlang- the card language- Gibt zurück:
- the matching
Card
-
getCardById
Retrieves a card by its unique identifier.- Parameter:
id- the card identifieridType- the type of identifier used- Gibt zurück:
- the matching
Card
-