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 from(RecordKey, 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 key paths.
  • Method Summary

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

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

    key
  • Method Details

    • from

      static ItemRecord from(RecordKey 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 key 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)
      Returns an InvalidItemRecord representing a missing or unresolved item section.
      Parameters:
      itemKey - the key that could not be resolved
      Returns:
      an invalid item record