java.lang.Object
com.winterhavenmc.library.messagebuilder.pipeline.retriever.MessageRetriever
All Implemented Interfaces:
Retriever

public final class MessageRetriever extends Object implements Retriever
Default implementation of the Retriever interface that retrieves a MessageRecord using a QueryHandler.

This class ensures safety and consistency by always returning a non-null record. If the underlying query handler fails to provide a valid message, a fallback empty record is returned instead.

This class is typically used as the entry point in a MessagePipeline.

See Also:
  • Constructor Details

    • MessageRetriever

      public MessageRetriever(QueryHandler<MessageRecord> queryHandler)
      Constructs a MessageRetriever using the specified query handler.
      Parameters:
      queryHandler - a handler responsible for resolving message records from a configuration source
  • Method Details