Record Class FinalMessageRecord
java.lang.Object
java.lang.Record
com.winterhavenmc.library.messagebuilder.models.language.FinalMessageRecord
- Record Components:
key- the original message stringenabled- whether this message is activemessage- the original raw message string (pre-resolution)repeatDelay- the repeat delay setting for this messagetitle- the raw title stringtitleFadeIn- title fade-in time in tickstitleStay- title stay time in tickstitleFadeOut- title fade-out time in tickssubtitle- the raw subtitle stringfinalMessageString- the resolved chat message string, if availablefinalTitleString- the resolved title string, if availablefinalSubtitleString- the resolved subtitle string, if available
- All Implemented Interfaces:
MessageRecord,SectionRecord
public record FinalMessageRecord(ValidMessageKey key, boolean enabled, String message, Duration repeatDelay, String title, Duration titleFadeIn, Duration titleStay, Duration 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(Section, Section, Section) 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 messagefinalTitleString– The resolved title (if any)finalSubtitleString– The resolved subtitle (if any)
Optional values to distinguish between
unresolved and empty content.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.winterhavenmc.library.messagebuilder.models.language.MessageRecord
MessageRecord.Field -
Constructor Summary
ConstructorsConstructorDescriptionFinalMessageRecord(ValidMessageKey key, boolean enabled, String message, Duration repeatDelay, String title, Duration titleFadeIn, Duration titleStay, Duration titleFadeOut, String subtitle, Optional<String> finalMessageString, Optional<String> finalTitleString, Optional<String> finalSubtitleString) Creates an instance of aFinalMessageRecordrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanenabled()Returns the value of theenabledrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefinalMessageStringrecord component.Returns the value of thefinalSubtitleStringrecord component.Returns the value of thefinalTitleStringrecord component.final inthashCode()Returns a hash code value for this object.key()Returns the value of thekeyrecord component.message()Returns the value of themessagerecord component.Returns the value of therepeatDelayrecord component.subtitle()Returns the value of thesubtitlerecord component.title()Returns the value of thetitlerecord component.Returns the value of thetitleFadeInrecord component.Returns the value of thetitleFadeOutrecord component.Returns the value of thetitleStayrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
FinalMessageRecord
public FinalMessageRecord(ValidMessageKey key, boolean enabled, String message, Duration repeatDelay, String title, Duration titleFadeIn, Duration titleStay, Duration titleFadeOut, String subtitle, Optional<String> finalMessageString, Optional<String> finalTitleString, Optional<String> finalSubtitleString) Creates an instance of aFinalMessageRecordrecord class.- Parameters:
key- the value for thekeyrecord componentenabled- the value for theenabledrecord componentmessage- the value for themessagerecord componentrepeatDelay- the value for therepeatDelayrecord componenttitle- the value for thetitlerecord componenttitleFadeIn- the value for thetitleFadeInrecord componenttitleStay- the value for thetitleStayrecord componenttitleFadeOut- the value for thetitleFadeOutrecord componentsubtitle- the value for thesubtitlerecord componentfinalMessageString- the value for thefinalMessageStringrecord componentfinalTitleString- the value for thefinalTitleStringrecord componentfinalSubtitleString- the value for thefinalSubtitleStringrecord component
-
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
key
Returns the value of thekeyrecord component.- Specified by:
keyin interfaceSectionRecord- Returns:
- the value of the
keyrecord component
-
enabled
public boolean enabled()Returns the value of theenabledrecord component.- Returns:
- the value of the
enabledrecord component
-
message
Returns the value of themessagerecord component.- Returns:
- the value of the
messagerecord component
-
repeatDelay
Returns the value of therepeatDelayrecord component.- Returns:
- the value of the
repeatDelayrecord component
-
title
Returns the value of thetitlerecord component.- Returns:
- the value of the
titlerecord component
-
titleFadeIn
Returns the value of thetitleFadeInrecord component.- Returns:
- the value of the
titleFadeInrecord component
-
titleStay
Returns the value of thetitleStayrecord component.- Returns:
- the value of the
titleStayrecord component
-
titleFadeOut
Returns the value of thetitleFadeOutrecord component.- Returns:
- the value of the
titleFadeOutrecord component
-
subtitle
Returns the value of thesubtitlerecord component.- Returns:
- the value of the
subtitlerecord component
-
finalMessageString
Returns the value of thefinalMessageStringrecord component.- Returns:
- the value of the
finalMessageStringrecord component
-
finalTitleString
Returns the value of thefinalTitleStringrecord component.- Returns:
- the value of the
finalTitleStringrecord component
-
finalSubtitleString
Returns the value of thefinalSubtitleStringrecord component.- Returns:
- the value of the
finalSubtitleStringrecord component
-