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.
  • RecordKey is 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:
  • Class
    Description
    A sealed interface representing a string–value pair loaded from the CONSTANTS section of a language YAML file.
    A MessageRecord representing a fully constructed, macro-resolved message ready for delivery to a recipient.
    A ConstantRecord representing a missing or invalid constant from the CONSTANTS section of a language YAML file.
    An ItemRecord representing a missing or invalid item entry from the ITEMS section of a language YAML file.
    A MessageRecord representing a missing or invalid entry from the MESSAGES section of a language file.
     
    A sealed interface representing a record loaded from the ITEMS section of a language YAML file.
    Enumeration of field keys within an ItemRecord, mapping enum constants to their corresponding YAML string paths.
    A sealed interface representing a structured message record loaded from the MESSAGES section of a language YAML file.
    Enum representing the fields defined in a ValidMessageRecord.
    An enumeration of Sections that correspond directly to each top level ConfigurationSection of the language file.
    A sealed interface representing a validated record loaded from a structured section of a language YAML file.
    A validated, immutable ConstantRecord representing a constant value loaded from the CONSTANTS section of a language YAML file.
    A validated, immutable ItemRecord representing a localized or macro-enabled item definition loaded from the ITEMS section of a language YAML file.
    A validated, immutable MessageRecord representing a single entry from the MESSAGES section of a language YAML file.