Class ItemQueryHandler
java.lang.Object
com.winterhavenmc.library.messagebuilder.query.ItemQueryHandler
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRetrieve an item record from the language file for the currently configured language.
-
Constructor Details
-
ItemQueryHandler
Class constructor
-
-
Method Details
-
getRecord
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 interfaceQueryHandler<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.
-