Package com.winterhavenmc.library.messagebuilder.models.language
package com.winterhavenmc.library.messagebuilder.models.language
Provides interfaces and data models that represent entries from the plugin's
language YAML file. These records abstract the three top-level sections of the
file:
MESSAGES, ITEMS, and CONSTANTS.
Overview
Each section is represented by a sealed interface:
These interfaces have two core implementations:- Valid record types (e.g.,
ValidMessageRecord) that contain fully parsed, structured data - Invalid record types (e.g.,
InvalidItemRecord) that represent missing or invalid entries
The use of sealed interfaces ensures that all variants are accounted for and safely handled throughout the MessageBuilder pipeline.
Design Notes
- All types follow the data-driven design pattern: validation occurs at construction time.
- Factory methods such as
from(...)are used to ensure all instances are safe and complete. RecordKeyis used as a strongly typed identifier across all sections.
Typical Usage
ItemRecord itemRecord = queryHandler.getItemRecord(MY_ITEM_KEY);
if (itemRecord instanceof ValidItemRecord valid) {
Section name = valid.name();
}
- See Also:
-
ClassDescriptionA sealed interface representing a string–value pair loaded from the
CONSTANTSsection of a language YAML file.AMessageRecordrepresenting a fully constructed, macro-resolved message ready for delivery to a recipient.AConstantRecordrepresenting a missing or invalid constant from theCONSTANTSsection of a language YAML file.AnItemRecordrepresenting a missing or invalid item entry from theITEMSsection of a language YAML file.AMessageRecordrepresenting a missing or invalid entry from theMESSAGESsection of a language file.A sealed interface representing a record loaded from theITEMSsection of a language YAML file.Enumeration of field keys within anItemRecord, mapping enum constants to their corresponding YAML string paths.A sealed interface representing a structured message record loaded from theMESSAGESsection of a language YAML file.Enum representing the fields defined in aValidMessageRecord.An enumeration of Sections that correspond directly to each top levelConfigurationSectionof the language file.A sealed interface representing a validated record loaded from a structured section of a language YAML file.A validated, immutableConstantRecordrepresenting a constant value loaded from theCONSTANTSsection of a language YAML file.A validated, immutableItemRecordrepresenting a localized or macro-enabled item definition loaded from theITEMSsection of a language YAML file.A validated, immutableMessageRecordrepresenting a single entry from theMESSAGESsection of a language YAML file.