io.agora.rtm.LockEvent Maven / Gradle / Ivy
package io.agora.rtm;
import io.agora.common.internal.CalledByNative;
import io.agora.rtm.LockDetail;
import io.agora.rtm.RtmConstants.RtmChannelType;
import io.agora.rtm.RtmConstants.RtmLockEventType;
import java.util.ArrayList;
import java.util.Arrays;
public class LockEvent {
/**
* Which channel type, RTM_CHANNEL_TYPE_STREAM or RTM_CHANNEL_TYPE_MESSAGE
*/
private RtmChannelType channelType;
/**
* Lock event type, indicate lock states
*/
private RtmLockEventType eventType;
/**
* The channel which the lock event was triggered
*/
private String channelName = "";
/**
* The detail information of locks
*/
private ArrayList lockDetailList;
/**
* Creates a new instance of {@code LockEvent} with default parameters.
*/
public LockEvent() {
this.channelType = RtmChannelType.NONE;
this.eventType = RtmLockEventType.NONE;
this.lockDetailList = new ArrayList();
}
@CalledByNative
public LockEvent(String channelName, int channelType, int eventType, LockDetail[] lockDetails) {
this.channelType = RtmChannelType.getEnum(channelType);
this.eventType = RtmLockEventType.getEnum(eventType);
this.channelName = channelName;
this.lockDetailList = new ArrayList(Arrays.asList(lockDetails));
}
public RtmChannelType getChannelType() {
return this.channelType;
}
public RtmLockEventType getEventType() {
return this.eventType;
}
public String getChannelName() {
return this.channelName;
}
public ArrayList getLockDetailList() {
return this.lockDetailList;
}
@Override
public String toString() {
return "LockEvent {channelName: " + channelName + ", channelType: " + channelType
+ ", eventType: " + eventType + ", lockDetailList: " + lockDetailList + "}";
}
}