Package me.nickhanson.codeforge.service
Class QuoteService
java.lang.Object
me.nickhanson.codeforge.service.QuoteService
- All Implemented Interfaces:
PropertiesLoader
Service to fetch random programming quotes from an external API.
Caches the last fetched quote for a configurable duration to reduce API calls.
Supports filtering by author and tags via configuration properties.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionFetches a random programming quote from the external API.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface me.nickhanson.codeforge.config.PropertiesLoader
loadProperties
-
Constructor Details
-
QuoteService
public QuoteService()
-
-
Method Details
-
getRandomQuote
Fetches a random programming quote from the external API. Caches the result for a configurable duration to minimize API calls. Applies user-specified filters for author and tags.- Returns:
- A formatted quote string in the format: "text — Author"
-