Class ConstantQueryHandler

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

public class ConstantQueryHandler extends Object implements QueryHandler<ConstantRecord>
Query handler for the 'CONSTANTS' section of the language file.
  • Constructor Details

    • ConstantQueryHandler

      public ConstantQueryHandler(SectionProvider sectionProvider)
      Class constructor
      Throws:
      ValidationException - if the yamlConfigurationSupplier parameter is null or invalid
  • Method Details

    • getString

      public Optional<String> getString(RecordKey key)
      Query the constants section of the language file for a String with keyPath
      Parameters:
      key - the keyPath of the String to be retrieved
      Returns:
      an Optional String containing the String retrieved with keyPath, or an empty Optional if no value was found for the keyPath
    • getStringList

      public List<String> getStringList(RecordKey key)
      Query the constants section of the language file for a List of String with the keyPath
      Parameters:
      key - the keyPath of the List to be retrieved
      Returns:
      a List of String containing the values retrieved using keyPath, or an empty List if no value was found for the keyPath
    • getInt

      public int getInt(RecordKey key)
      Query the constants section of the language file for an int with the keyPath
      Parameters:
      key - the keyPath of the int to be retrieved
      Returns:
      int containing the values retrieved using keyPath, or zero (0) if no value was found for the keyPath
    • getRecord

      public ConstantRecord getRecord(RecordKey key)
      Stub method until implemented
      Specified by:
      getRecord in interface QueryHandler<ConstantRecord>
      Parameters:
      key - the record key
      Returns:
      a ConstantRecord