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

cn.leancloud.im.v2.AVIMMessageQueryDirection Maven / Gradle / Ivy

There is a newer version: 8.2.28
Show newest version
package cn.leancloud.im.v2;

public enum AVIMMessageQueryDirection {
  AVIMMessageQueryDirectionUnknown(-1),
  AVIMMessageQueryDirectionFromNewToOld(0),
  AVIMMessageQueryDirectionFromOldToNew(1);

  private static String descriptions[] = new String[]{"Unknown", "Old", "New"};
  private int code = -1;

  private AVIMMessageQueryDirection(int code) {
    this.code = code;
  }

  public int getCode() {
    return this.code;
  }

  public String getDescription() {
    return descriptions[code + 1];
  }

  public static AVIMMessageQueryDirection parseFromCode(int code) {
    switch (code) {
      case 0:
        return AVIMMessageQueryDirectionFromNewToOld;
      case 1:
        return AVIMMessageQueryDirectionFromOldToNew;
      default:
        return AVIMMessageQueryDirectionUnknown;
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy