io.agora.rtm.SubscribeOptions Maven / Gradle / Ivy
package io.agora.rtm;
import io.agora.common.internal.CalledByNative;
/**
* The subscribe option.
*/
public class SubscribeOptions {
/**
* Whether to subscribe channel with message
*/
private boolean withMessage;
/**
* Whether to subscribe channel with user presence
*/
private boolean withPresence;
/**
* Whether to subscribe channel with metadata
*/
private boolean withMetadata;
/**
* Whether to subscribe channel with lock
*/
private boolean withLock;
/**
* The default Constructor of {@code SubscribeOptions}.
*/
public SubscribeOptions() {
this.withMessage = true;
this.withPresence = true;
this.withMetadata = false;
this.withLock = false;
}
/**
* Creates a new instance of {@code SubscribeOptions} with specifies options.
*
* @param withMessage Indicates whether subscribe message event notify
* @param withPresence Indicates whether subscribe presence event notify
* @param withMetadata Indicates whether subscribe storage event notify
* @param withLock Indicates whether subscribe lock event notify
*/
public SubscribeOptions(
boolean withMessage, boolean withPresence, boolean withMetadata, boolean withLock) {
this.withMessage = withMessage;
this.withPresence = withPresence;
this.withMetadata = withMetadata;
this.withLock = withLock;
}
public void setWithMessage(boolean withMessage) {
this.withMessage = withMessage;
}
public void setWithPresence(boolean withPresence) {
this.withPresence = withPresence;
}
public void setWithMetadata(boolean withMetadata) {
this.withMetadata = withMetadata;
}
public void setWithLock(boolean withLock) {
this.withLock = withLock;
}
@CalledByNative
public boolean getWithMessage() {
return this.withMessage;
}
@CalledByNative
public boolean getWithPresence() {
return this.withPresence;
}
@CalledByNative
public boolean getWithMetadata() {
return this.withMetadata;
}
@CalledByNative
public boolean getWithLock() {
return this.withLock;
}
@Override
public String toString() {
return "SubscribeOptions {withMessage: " + withMessage + ", withPresence: " + withPresence
+ ", withMetadata: " + withMetadata + ", withLock: " + withLock + "}";
}
}