Class ValidItemRecord
java.lang.Object
com.winterhavenmc.library.messagebuilder.models.language.ValidItemRecord
- All Implemented Interfaces:
ItemRecord,SectionRecord
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:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.winterhavenmc.library.messagebuilder.models.language.ItemRecord
ItemRecord.Field -
Method Summary
Modifier and TypeMethodDescriptionstatic ValidItemRecordcreate(ValidItemKey key, org.bukkit.configuration.ConfigurationSection section) Creates aValidItemRecordfrom a configuration section.key()lore()material()name()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.winterhavenmc.library.messagebuilder.models.language.ItemRecord
isValid
-
Method Details
-
create
public static ValidItemRecord create(ValidItemKey key, org.bukkit.configuration.ConfigurationSection section) Creates aValidItemRecordfrom 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 itemsection- the configuration section representing the item- Returns:
- a new validated item record
-
key
- Specified by:
keyin interfaceSectionRecord
-
name
-
pluralName
-
displayName
-
lore
-
material
-