Record Class FinalMessageRecord

java.lang.Object
java.lang.Record
com.winterhavenmc.library.messagebuilder.model.language.FinalMessageRecord
Record Components:
key - the original message key
enabled - whether this message is active
message - the original raw message string (pre-resolution)
repeatDelay - the repeat delay setting for this message
title - the raw title string
titleFadeIn - title fade-in time in ticks
titleStay - title stay time in ticks
titleFadeOut - title fade-out time in ticks
subtitle - the raw subtitle string
finalMessageString - the resolved chat message string, if available
finalTitleString - the resolved title string, if available
finalSubtitleString - the resolved subtitle string, if available
All Implemented Interfaces:
MessageRecord, SectionRecord

public record FinalMessageRecord(RecordKey key, boolean enabled, String message, Duration repeatDelay, String title, int titleFadeIn, int titleStay, int titleFadeOut, String subtitle, Optional<String> finalMessageString, Optional<String> finalTitleString, Optional<String> finalSubtitleString) extends Record implements MessageRecord
A MessageRecord representing a fully constructed, macro-resolved message ready for delivery to a recipient.

This record is typically derived from a ValidMessageRecord using the ValidMessageRecord.withFinalStrings(String, String, String) method. It retains all original message metadata while attaching resolved versions of the chat message, title, and subtitle strings.

Resolved Fields

The following fields contain the final rendered output after macro resolution:
  • finalMessageString – The resolved chat message
  • finalTitleString – The resolved title (if any)
  • finalSubtitleString – The resolved subtitle (if any)
These are provided as Optional values to distinguish between unresolved and empty content.
See Also:
  • Constructor Details

    • FinalMessageRecord

      public FinalMessageRecord(RecordKey key, boolean enabled, String message, Duration repeatDelay, String title, int titleFadeIn, int titleStay, int titleFadeOut, String subtitle, Optional<String> finalMessageString, Optional<String> finalTitleString, Optional<String> finalSubtitleString)
      Creates an instance of a FinalMessageRecord record class.
      Parameters:
      key - the value for the key record component
      enabled - the value for the enabled record component
      message - the value for the message record component
      repeatDelay - the value for the repeatDelay record component
      title - the value for the title record component
      titleFadeIn - the value for the titleFadeIn record component
      titleStay - the value for the titleStay record component
      titleFadeOut - the value for the titleFadeOut record component
      subtitle - the value for the subtitle record component
      finalMessageString - the value for the finalMessageString record component
      finalTitleString - the value for the finalTitleString record component
      finalSubtitleString - the value for the finalSubtitleString record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • key

      public RecordKey key()
      Returns the value of the key record component.
      Specified by:
      key in interface SectionRecord
      Returns:
      the value of the key record component
    • enabled

      public boolean enabled()
      Returns the value of the enabled record component.
      Returns:
      the value of the enabled record component
    • message

      public String message()
      Returns the value of the message record component.
      Returns:
      the value of the message record component
    • repeatDelay

      public Duration repeatDelay()
      Returns the value of the repeatDelay record component.
      Returns:
      the value of the repeatDelay record component
    • title

      public String title()
      Returns the value of the title record component.
      Returns:
      the value of the title record component
    • titleFadeIn

      public int titleFadeIn()
      Returns the value of the titleFadeIn record component.
      Returns:
      the value of the titleFadeIn record component
    • titleStay

      public int titleStay()
      Returns the value of the titleStay record component.
      Returns:
      the value of the titleStay record component
    • titleFadeOut

      public int titleFadeOut()
      Returns the value of the titleFadeOut record component.
      Returns:
      the value of the titleFadeOut record component
    • subtitle

      public String subtitle()
      Returns the value of the subtitle record component.
      Returns:
      the value of the subtitle record component
    • finalMessageString

      public Optional<String> finalMessageString()
      Returns the value of the finalMessageString record component.
      Returns:
      the value of the finalMessageString record component
    • finalTitleString

      public Optional<String> finalTitleString()
      Returns the value of the finalTitleString record component.
      Returns:
      the value of the finalTitleString record component
    • finalSubtitleString

      public Optional<String> finalSubtitleString()
      Returns the value of the finalSubtitleString record component.
      Returns:
      the value of the finalSubtitleString record component