Class UrlShortenerConfig

java.lang.Object
org.gcube.application.shlink.discovery.UrlShortenerConfig

public class UrlShortenerConfig extends Object
Bean class representing the configuration for the URL shortener service. This class holds the essential properties needed to interact with the Shlink URL shortener API.
Since:
July 2025
Author:
Francesco Mangiacrapa at ISTI-CNR
  • Constructor Details

    • UrlShortenerConfig

      public UrlShortenerConfig()
      Default constructor.
    • UrlShortenerConfig

      public UrlShortenerConfig(String shortnerServiceUrl, String apiKey, String domain)
      Constructor with all parameters.
      Parameters:
      shortnerServiceUrl - the service URL
      apiKey - the api key
      domain - the domain (can be null)
  • Method Details

    • getShortnerServiceUrl

      public String getShortnerServiceUrl()
      Gets the service URL.
      Returns:
      the service URL
    • setShortnerServiceUrl

      protected void setShortnerServiceUrl(String shortnerServiceUrl)
      Sets the service URL.
      Parameters:
      shortnerServiceUrl - the service URL to set
    • getDomain

      public String getDomain()
      Gets the domain.
      Returns:
      the domain
    • getApiKey

      public String getApiKey()
      Gets the api key.
      Returns:
      the api key
    • setApiKey

      protected void setApiKey(String apiKey)
      Sets the api key.
      Parameters:
      apiKey - the new api key
    • setDomain

      protected void setDomain(String domain)
      Sets the domain.
      Parameters:
      domain - the domain to set
    • isValid

      public boolean isValid()
      Validates that the configuration has the required properties.
      Returns:
      true if the configuration is valid, false otherwise
    • toString

      public String toString()
      To string.
      Overrides:
      toString in class Object
      Returns:
      the string