All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.agora.rtm.TopicMessageOptions Maven / Gradle / Ivy

package io.agora.rtm;

import io.agora.common.internal.CalledByNative;
import io.agora.rtm.RtmConstants.RtmMessageType;

/**
 * topic message option
 */
public class TopicMessageOptions {
  /**
   * The time to calibrate data with media,
   * only valid when user join topic with syncWithMedia in stream channel
   */
  private long sendTs;

  /**
   * The custom type of the message, up to 32 bytes for customize.
   */
  private String customType = "";

  /**
   * Creates a new instance of {@code TopicMessageOptions} with default parameters.
   */
  public TopicMessageOptions() {
    this.sendTs = 0;
  }

  /**
   * Creates a new instance of {@code TopicMessageOptions} with specified customType.
   *
   * @param customType The custom type of the message
   */
  public TopicMessageOptions(String customType) {
    this.customType = customType;
  }

  /**
   * Creates a new instance of {@code TopicMessageOptions} with specified customType and sendTs.
   *
   * @param customType The custom type of the message
   * @param sendTs The time to calibrate data with media
   */
  public TopicMessageOptions(String customType, long sendTs) {
    this.customType = customType;
    this.sendTs = sendTs;
  }

  public void setCustomType(String customType) {
    this.customType = customType;
  }

  public void setSendTs(long sendTs) {
    this.sendTs = sendTs;
  }

  @CalledByNative
  public String getCustomType() {
    return this.customType;
  }

  @CalledByNative
  public long getSendTs() {
    return this.sendTs;
  }

  public String toString() {
    return "TopicMessageOptions {sendTs: " + sendTs + ", customType: " + customType + "}";
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy