Klasse SetRequester

java.lang.Object
net.dzultra.jsa.sets.SetRequester

public class SetRequester extends Object
High-level API service for retrieving Magic: The Gathering set data.

This class provides simplified access to Scryfall set-related endpoints, abstracting away request building and execution. It delegates HTTP calls and response handling to SetSearchExecutor.

It acts as the main entry point for set-related operations in the JSA library.

  • Felddetails

    • gson

      protected com.google.gson.Gson gson
      Gson instance used for JSON serialization and deserialization.
    • client

      public final ScryfallClient client
      The Scryfall client responsible for HTTP communication.
    • executor

      public final SetSearchExecutor executor
      The executor responsible for performing API requests and parsing responses.
  • Konstruktordetails

    • SetRequester

      public SetRequester(ScryfallClient client)
      Constructs a new SetRequester.

      Initializes the internal SetSearchExecutor using the provided client and a default Gson instance.

      Parameter:
      client - the Scryfall client used for API communication
  • Methodendetails

    • getAllSets

      public MTGSetList getAllSets()
      Retrieves all available Magic: The Gathering sets.
      Gibt zurück:
      a MTGSetList containing all sets returned by the API
    • getSetByCode

      public MTGSet getSetByCode(String code)
      Retrieves a Magic: The Gathering set by its set code.
      Parameter:
      code - the set code (e.g., "neo", "khm")
      Gibt zurück:
      the corresponding MTGSet
    • getSetByTCGPlayerID

      public MTGSet getSetByTCGPlayerID(int id)
      Retrieves a set using its TCGPlayer identifier.
      Parameter:
      id - the numeric TCGPlayer ID
      Gibt zurück:
      the corresponding MTGSet
    • getSetByUUID

      public MTGSet getSetByUUID(UUID id)
      Retrieves a set using its unique UUID.
      Parameter:
      id - the UUID of the set
      Gibt zurück:
      the corresponding MTGSet