java.lang.Object
com.winterhavenmc.library.messagebuilder.models.language.ValidItemRecord
All Implemented Interfaces:
ItemRecord, SectionRecord

public final class ValidItemRecord extends Object implements ItemRecord
A validated, immutable ItemRecord representing a localized or macro-enabled item definition loaded from the ITEMS section of a language YAML file.

A ValidItemRecord includes singular and plural display names, optional inventory-specific name overrides, and a list of lore lines. It also implements Pluralizable to provide dynamic name selection based on quantity.

This class is instantiated using the static create(ValidItemKey, ConfigurationSection) method, which applies YAML-based parsing and normalization of optional fields.

See Also:
  • Method Details

    • create

      public static ValidItemRecord create(ValidItemKey key, org.bukkit.configuration.ConfigurationSection section)
      Creates a ValidItemRecord from a configuration section.

      This method parses each field from the YAML structure and wraps the result into a validated record. All fields are assumed to be non-null if present, and fallback behavior is the caller's responsibility.

      Parameters:
      key - the unique identifier for this item
      section - the configuration section representing the item
      Returns:
      a new validated item record
    • key

      public ItemKey key()
      Specified by:
      key in interface SectionRecord
    • name

      public String name()
    • pluralName

      public String pluralName()
    • displayName

      public String displayName()
    • lore

      public List<String> lore()
    • material

      public String material()