Package com.winterhavenmc.library.messagebuilder.model.language


package com.winterhavenmc.library.messagebuilder.model.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) {
	String name = valid.nameSingular();
}
See Also: