Record Class ChannelCapabilities

java.lang.Object
java.lang.Record
com.tnsai.channels.api.ChannelCapabilities
Record Components:
threads - whether the channel supports threaded conversations
reactions - whether emoji reactions are supported
fileUpload - whether file/document uploads are supported
voice - whether voice messages are supported
typing - whether typing indicators can be sent
editing - whether sent messages can be edited (for streaming)
streaming - whether token-by-token streaming is possible (via editing)
maxMessageLength - maximum text length per message (e.g. 4096 for Telegram)

public record ChannelCapabilities(boolean threads, boolean reactions, boolean fileUpload, boolean voice, boolean typing, boolean editing, boolean streaming, long maxMessageLength) extends Record
Declares what a channel adapter supports. Used by the router and response formatter to adapt behavior per channel.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    ChannelCapabilities(boolean threads, boolean reactions, boolean fileUpload, boolean voice, boolean typing, boolean editing, boolean streaming, long maxMessageLength)
    Creates an instance of a ChannelCapabilities record class.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    boolean
    Returns the value of the editing record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    boolean
    Returns the value of the fileUpload record component.
    final int
    Returns a hash code value for this object.
    long
    Returns the value of the maxMessageLength record component.
    boolean
    Returns the value of the reactions record component.
    boolean
    Returns the value of the streaming record component.
    boolean
    Returns the value of the threads record component.
    final String
    Returns a string representation of this record class.
    boolean
    Returns the value of the typing record component.
    boolean
    Returns the value of the voice record component.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ChannelCapabilities

      public ChannelCapabilities(boolean threads, boolean reactions, boolean fileUpload, boolean voice, boolean typing, boolean editing, boolean streaming, long maxMessageLength)
      Creates an instance of a ChannelCapabilities record class.
      Parameters:
      threads - the value for the threads record component
      reactions - the value for the reactions record component
      fileUpload - the value for the fileUpload record component
      voice - the value for the voice record component
      typing - the value for the typing record component
      editing - the value for the editing record component
      streaming - the value for the streaming record component
      maxMessageLength - the value for the maxMessageLength record component
  • Method Details

    • builder

      public static ChannelCapabilities.Builder builder()
    • 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 '=='.
      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.
    • threads

      public boolean threads()
      Returns the value of the threads record component.
      Returns:
      the value of the threads record component
    • reactions

      public boolean reactions()
      Returns the value of the reactions record component.
      Returns:
      the value of the reactions record component
    • fileUpload

      public boolean fileUpload()
      Returns the value of the fileUpload record component.
      Returns:
      the value of the fileUpload record component
    • voice

      public boolean voice()
      Returns the value of the voice record component.
      Returns:
      the value of the voice record component
    • typing

      public boolean typing()
      Returns the value of the typing record component.
      Returns:
      the value of the typing record component
    • editing

      public boolean editing()
      Returns the value of the editing record component.
      Returns:
      the value of the editing record component
    • streaming

      public boolean streaming()
      Returns the value of the streaming record component.
      Returns:
      the value of the streaming record component
    • maxMessageLength

      public long maxMessageLength()
      Returns the value of the maxMessageLength record component.
      Returns:
      the value of the maxMessageLength record component