Interface ItemRecord
- All Superinterfaces:
SectionRecord
- All Known Implementing Classes:
InvalidItemRecord
,ValidItemRecord
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
ValidItemRecord
– A fully parsed and validated item entryInvalidItemRecord
– A fallback object representing a missing or invalid item definition
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 ClassesModifier and TypeInterfaceDescriptionstatic enum
Enumeration of field keys within anItemRecord
, mapping enum constants to their corresponding YAML key paths. -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic InvalidItemRecord
Returns anInvalidItemRecord
representing a missing or unresolved item section.static ItemRecord
Creates anItemRecord
from the given configuration section.Methods inherited from interface com.winterhavenmc.library.messagebuilder.model.language.SectionRecord
key
-
Method Details
-
from
Creates anItemRecord
from the given configuration section.If the section is
null
, anInvalidItemRecord
is returned with a reason indicating the failure. Otherwise, aValidItemRecord
is created using parsed and validated values.- Parameters:
itemKey
- the key identifying this item recorditemEntry
- the configuration section associated with this item- Returns:
- a valid or invalid
ItemRecord
, depending on input
-
empty
Returns anInvalidItemRecord
representing a missing or unresolved item section.- Parameters:
itemKey
- the key that could not be resolved- Returns:
- an invalid item record
-