All Superinterfaces:
SectionRecord
All Known Implementing Classes:
InvalidItemRecord, ValidItemRecord

public sealed interface ItemRecord extends SectionRecord permits ValidItemRecord, InvalidItemRecord
A sealed interface representing a record loaded from the ITEMS section of a language YAML file.

Item records contain metadata used to localize or customize item names, inventory display names, and lore descriptions. These values may be used dynamically in messages or as part of macro resolution, but are chiefly designed to provide localized strings for items to be created for use in plugins.

Implementations

Instances are created using of(ValidItemKey, ConfigurationSection), which applies default behavior and validation automatically.

This interface extends SectionRecord, allowing all item records to be safely passed through the macro and message systems once constructed.

See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static enum 
    Enumeration of field keys within an ItemRecord, mapping enum constants to their corresponding YAML string paths.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns an InvalidItemRecord representing a missing or unresolved item section.
     
    static ItemRecord
    of(ValidItemKey itemKey, org.bukkit.configuration.ConfigurationSection itemEntry)
    Creates an ItemRecord from the given configuration section.

    Methods inherited from interface com.winterhavenmc.library.messagebuilder.models.language.SectionRecord

    key
  • Method Details

    • of

      static ItemRecord of(ValidItemKey itemKey, org.bukkit.configuration.ConfigurationSection itemEntry)
      Creates an ItemRecord from the given configuration section.

      If the section is null, an InvalidItemRecord is returned with a reason indicating the failure. Otherwise, a ValidItemRecord is created using parsed and validated values.

      Parameters:
      itemKey - the string identifying this item record
      itemEntry - the configuration section associated with this item
      Returns:
      a valid or invalid ItemRecord, depending on input
    • empty

      static InvalidItemRecord empty(RecordKey itemKey, InvalidRecordReason reason)
      Returns an InvalidItemRecord representing a missing or unresolved item section.
      Parameters:
      itemKey - the string that could not be resolved
      Returns:
      an invalid item record
    • isValid

      default Optional<ValidItemRecord> isValid()