Class GoogleAPIKey

java.lang.Object
org.kissweb.googleMapsAPI.GoogleAPIKey

public class GoogleAPIKey extends Object
Class used to store the global key for Google API.
  • Constructor Details

    • GoogleAPIKey

      public GoogleAPIKey()
  • Method Details

    • setAPIKey

      public static void setAPIKey(String key)
      Sets the global key for Google API.
      Parameters:
      key - The key to use for the Google API.
    • getAPIKey

      public static String getAPIKey()
      Retrieves the global key for Google API.

      This will return null if the key has not been set yet.
      Returns:
      the global key for Google API.
    • getValidAPIKey

      public static String getValidAPIKey()
      Retrieves the global key for Google API. If the key has not been set yet, this will throw a RuntimeException.
      Returns:
      the global key for Google API.
      Throws:
      RuntimeException - if the key has not been set yet