Klasse Symbology

java.lang.Object
net.dzultra.jsa.symbology.Symbology

public class Symbology extends Object
Provides access to the Scryfall symbology endpoints.

This class allows retrieval and parsing of card symbol definitions and mana cost representations from the Scryfall API. It uses a ScryfallClient for HTTP communication and Gson for JSON deserialization.

  • Felddetails

    • client

      protected final ScryfallClient client
      The client used to perform HTTP requests.
    • gson

      protected com.google.gson.Gson gson
      The Gson instance used for JSON deserialization.
    • endpoint

      public String endpoint
      The API endpoint for symbology-related requests.
    • response

      public String response
      Stores the last raw JSON response received from the API.
  • Konstruktordetails

    • Symbology

      public Symbology(ScryfallClient client)
      Constructs a new Symbology instance using the given client.
      Parameter:
      client - the ScryfallClient used to perform API requests
  • Methodendetails

    • getCardSymbols

      public SymbologyResponse getCardSymbols()
      Retrieves all card symbols from the Scryfall API.
      Gibt zurück:
      a SymbologyResponse containing all available card symbols
      Löst aus:
      SymbologyResponseException - if the request fails or the response is invalid
    • getManaCost

      public ManaCostResponse getManaCost(String manaCost)
      Parses a mana cost string into its structured representation.

      This method sends the given mana cost to the Scryfall API and returns a parsed response describing the individual symbols and their properties.

      Parameter:
      manaCost - the mana cost string to parse (e.g., "{2}{G}{G}" or "WUBRG")
      Gibt zurück:
      a ManaCostResponse representing the parsed mana cost
      Löst aus:
      SymbologyResponseException - if the request fails or the response is invalid