Class JournalEntry

java.lang.Object
mekhq.campaign.roleplay.JournalEntry

public class JournalEntry extends Object
One dated entry in the roleplay journal: either a rich-text note the player wrote, or an automatic Oracle log record. Entries can be tagged with the plot threads and Oracle characters they involve, so a storyline can be read on its own.

Notes are stored as HTML; Oracle log records are plain text. getPlainText() gives either as plain text.

  • Constructor Details

  • Method Details

    • newNote

      public static JournalEntry newNote(LocalDate date)
      Creates an empty note.
      Parameters:
      date - the in-game date of the note
      Returns:
      the note
    • getDate

      public LocalDate getDate()
    • setDate

      public void setDate(LocalDate date)
    • getType

      public JournalEntryType getType()
    • isNote

      public boolean isNote()
      Returns:
      true if this is a note the player wrote, rather than an Oracle log record
    • getText

      public String getText()
      Returns:
      the stored text: HTML for a note, plain text for an Oracle log record
    • setText

      public void setText(String text)
    • getPlainText

      public String getPlainText()
      Returns:
      the entry's text with any formatting removed
    • getHtmlBody

      public String getHtmlBody()
      Returns:
      the entry's text as an HTML fragment, suitable for placing inside a larger HTML document
    • getThreads

      public Set<UUID> getThreads()
      Returns:
      the live set of ids of the plot threads this entry is tagged with
    • getCharacters

      public Set<UUID> getCharacters()
      Returns:
      the live set of ids of the Oracle characters this entry is tagged with
    • getAnswer

      @Nullable public OracleAnswer getAnswer()
      Returns:
      the Fate Chart question this record logs, or null if it is not a Fate Chart record
    • setAnswer

      public void setAnswer(@Nullable OracleAnswer answer)
    • getCheck

      @Nullable public CheckRecord getCheck()
      Returns:
      the check this record logs, or null if it is not a check record
    • setCheck

      public void setCheck(@Nullable CheckRecord check)
    • tagThread

      public JournalEntry tagThread(@Nullable PlotThread thread)
      Tags this entry with a plot thread.
      Parameters:
      thread - the thread, or null to do nothing
      Returns:
      this entry, for chaining
    • tagCharacter

      public JournalEntry tagCharacter(@Nullable OracleCharacter character)
      Tags this entry with an Oracle character.
      Parameters:
      character - the character, or null to do nothing
      Returns:
      this entry, for chaining