Class UrlShortenerConfig
java.lang.Object
org.gcube.application.shlink.discovery.UrlShortenerConfig
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 Summary
ConstructorsConstructorDescriptionDefault constructor.UrlShortenerConfig(String shortnerServiceUrl, String apiKey, String domain) Constructor with all parameters. -
Method Summary
Modifier and TypeMethodDescriptionGets the api key.Gets the domain.Gets the service URL.booleanisValid()Validates that the configuration has the required properties.protected voidSets the api key.protected voidSets the domain.protected voidsetShortnerServiceUrl(String shortnerServiceUrl) Sets the service URL.toString()To string.
-
Constructor Details
-
UrlShortenerConfig
public UrlShortenerConfig()Default constructor. -
UrlShortenerConfig
Constructor with all parameters.- Parameters:
shortnerServiceUrl- the service URLapiKey- the api keydomain- the domain (can be null)
-
-
Method Details
-
getShortnerServiceUrl
Gets the service URL.- Returns:
- the service URL
-
setShortnerServiceUrl
Sets the service URL.- Parameters:
shortnerServiceUrl- the service URL to set
-
getDomain
Gets the domain.- Returns:
- the domain
-
getApiKey
Gets the api key.- Returns:
- the api key
-
setApiKey
Sets the api key.- Parameters:
apiKey- the new api key
-
setDomain
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
To string.
-