io.agora.rtm.IntervalInfo Maven / Gradle / Ivy
package io.agora.rtm;
import io.agora.common.internal.CalledByNative;
import io.agora.rtm.UserState;
import java.util.ArrayList;
import java.util.Arrays;
/**
* The interval information of presence event.
*/
public class IntervalInfo {
/**
* Joined users during this interval
*/
private ArrayList joinUserList;
/**
* Left users during this interval
*/
private ArrayList leaveUserList;
/**
* Timeout users during this interval
*/
private ArrayList timeoutUserList;
/**
* The users state changed during this interval
*/
private ArrayList userStateList;
/**
* Constructs a new {@code IntervalInfo} object with empty
* joinUserList, leaveUserList, timeoutUserList and userStateList.
*/
public IntervalInfo() {
this.joinUserList = new ArrayList<>();
this.leaveUserList = new ArrayList<>();
this.timeoutUserList = new ArrayList<>();
this.userStateList = new ArrayList<>();
}
@CalledByNative
public IntervalInfo(String[] joinUserList, String[] leaveUserList, String[] timeoutUserList,
UserState[] userStateList) {
this.joinUserList = new ArrayList(Arrays.asList(joinUserList));
this.leaveUserList = new ArrayList(Arrays.asList(leaveUserList));
this.timeoutUserList = new ArrayList(Arrays.asList(timeoutUserList));
this.userStateList = new ArrayList(Arrays.asList(userStateList));
}
public ArrayList getJoinUserList() {
return this.joinUserList;
}
public ArrayList getLeaveUserList() {
return this.leaveUserList;
}
public ArrayList getTimeoutUserList() {
return this.timeoutUserList;
}
public ArrayList getUserStateList() {
return this.userStateList;
}
@Override
public String toString() {
return "IntervalInfo {joinUserList: " + joinUserList + ", leaveUserList: " + leaveUserList
+ ", timeoutUserList: " + timeoutUserList + ", userStateList: " + userStateList + "}";
}
}