Class StagedMessage

java.lang.Object
net.vincent.communidirect.client.util.StagedMessage

public final class StagedMessage extends Object
Immutable data bag for a message that has been composed but not yet sent. Instances are produced by MessageParser from either a raw editor temp-file or a persisted staged TOML file.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final String
    Plaintext message body.
    final String
    Alias of the recipient's public key in the local key store.
    final int
    Destination TCP port for the remote server.
    final String
    Destination IPv4/IPv6 address or hostname for message delivery.
  • Constructor Summary

    Constructors
    Constructor
    Description
    StagedMessage(String targetIp, int port, String keyName, String body)
    Constructs a StagedMessage, trimming whitespace from string fields and guarding against null inputs.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns true when all required fields are filled in.
    Returns a compact debug representation containing all fields.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • targetIp

      public final String targetIp
      Destination IPv4/IPv6 address or hostname for message delivery.
    • port

      public final int port
      Destination TCP port for the remote server.
    • keyName

      public final String keyName
      Alias of the recipient's public key in the local key store.
    • body

      public final String body
      Plaintext message body.
  • Constructor Details

    • StagedMessage

      public StagedMessage(String targetIp, int port, String keyName, String body)
      Constructs a StagedMessage, trimming whitespace from string fields and guarding against null inputs.
      Parameters:
      targetIp - destination IPv4/IPv6 address or hostname
      port - destination TCP port (1–65535)
      keyName - alias of the recipient's public key in the local key store
      body - plaintext message body
  • Method Details

    • isValid

      public boolean isValid()
      Returns true when all required fields are filled in.
      Returns:
      true if targetIp, keyName, and body are all non-empty; false otherwise
    • toString

      public String toString()
      Returns a compact debug representation containing all fields.
      Overrides:
      toString in class Object
      Returns:
      string in the form StagedMessage{ip=…, port=…, key=…, bodyLen=…}