Record Class ColonyNotice

java.lang.Object
java.lang.Record
forgottentowns.mod.api.ColonyNotice
Record Components:
key - translation key in the sending mod's namespace
arguments - at most eight short display values, such as captured names or formatted counts
focus - optional tile to center when the player clicks the alert or log entry
tone - visual emphasis; all tones use the game's existing general notification sound

public record ColonyNotice(String key, List<String> arguments, ColonyContext.Position focus, ColonyNotice.Tone tone) extends Record
A localized event-log message and transient alert, optionally focusing a world tile.
  • Constructor Details

    • ColonyNotice

      public ColonyNotice(String key, List<String> arguments, ColonyContext.Position focus, ColonyNotice.Tone tone)
      Copies arguments and validates message-size limits before crossing into the host. Key ownership, translation availability, and focus bounds are checked when the notice is posted.
      Parameters:
      key - nonblank translation key of at most 256 characters
      arguments - at most eight nonnull strings of at most 256 characters each
      focus - optional camera destination
      tone - required emphasis
      Throws:
      NullPointerException - if key, arguments, an argument or tone is null
      IllegalArgumentException - if the key is blank/overlong, there are more than eight arguments, or any argument exceeds 256 UTF-16 characters
  • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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 String key()
      Returns the value of the key record component.
      Returns:
      the value of the key record component
    • arguments

      public List<String> arguments()
      Returns the value of the arguments record component.
      Returns:
      the value of the arguments record component
    • focus

      public ColonyContext.Position focus()
      Returns the value of the focus record component.
      Returns:
      the value of the focus record component
    • tone

      public ColonyNotice.Tone tone()
      Returns the value of the tone record component.
      Returns:
      the value of the tone record component