Class ItemQueryHandler

java.lang.Object
com.winterhavenmc.library.messagebuilder.query.ItemQueryHandler
All Implemented Interfaces:
QueryHandler<ItemRecord>

public class ItemQueryHandler extends Object implements QueryHandler<ItemRecord>
Handles queries for item records from the current language file. The constructor takes the ITEMS configuration section as a parameter, and throws an exception if the provided configuration section is not the language file item section.
  • Constructor Details

    • ItemQueryHandler

      public ItemQueryHandler(SectionProvider sectionProvider)
      Class constructor
  • Method Details

    • getRecord

      public ItemRecord getRecord(RecordKey key)
      Retrieve an item record from the language file for the currently configured language. If a record cannot be found for the keyPath, an empty Optional will be returned.
      Specified by:
      getRecord in interface QueryHandler<ItemRecord>
      Parameters:
      key - the keyPath for the item record in the language file
      Returns:
      an Optional ValidItemRecord if a matching record was found, or an empty Optional if not.