[TOC]

跳过导航链接

cn.jpush.im.android.api.model

类 DeviceInfo

  • java.lang.Object
    • cn.jpush.im.android.api.model.DeviceInfo

public class DeviceInfo
extends java.lang.Object

设备状态信息,使用JMessageClient.login(String, String, RequestCallback)可以返回账号所登陆过的设备信息。

  • 从以下版本开始:
  • 2.5.0

构造器概要

构造器 构造器和说明 DeviceInfo(long juid, PlatformType platformType, int lastLoginTime, int onlineStatus, boolean isLogin, int flag)

方法概要

所有方法 静态方法;) 实例方法;) 具体方法;) 限定符和类型 方法和说明 static java.lang.String collectionToJson(java.util.Collection deviceInfos) 将DeviceInfo对象的集合类转换为Json字符串,使用fromJsonToCollection(String)转换回来 static DeviceInfo fromJson(java.lang.String jsonString) 从Json字符串转换成DeviceInfo对象,转换失败返回null static java.util.Collection fromJsonToCollection(java.lang.String jsonString) 从Json字符串转换成Collection对象,方便DeviceInfo的集合类的转换,转换失败返回null long getDeviceID() 获取设备ID int getFlag() 默认为0,1表示该设备被当前登录设备踢出 int getLastLoginTime() 获取设备最近一次登陆时间,单位-秒 int getOnlineStatus() 获取设备在线状态,0不在线,1在线 PlatformType getPlatformType() 获取设备所属平台类型PlatformType boolean isLogin() 判断设备当前是否处于登陆状态, true:登陆,false:登出 java.lang.String toJson() 将对象转换为Json字符串,使用fromJson(String)转换回来

-    

从类继承的方法 java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

构造器详细资料

-  

DeviceInfo

public DeviceInfo(long juid,
                  PlatformType platformType,
                  int lastLoginTime,
                  int onlineStatus,
                  boolean isLogin,
                  int flag)

方法详细资料

-  

getDeviceID

public long getDeviceID()

获取设备ID

  - 返回: 
  - 设备ID        
-  

getPlatformType

public PlatformType getPlatformType()

获取设备所属平台类型PlatformType

  - 返回: 
  - 设备类型        
-  

getOnlineStatus

public int getOnlineStatus()

获取设备在线状态,0不在线,1在线

  - 返回: 
  - 设备在线状态        
-  

isLogin

public boolean isLogin()

判断设备当前是否处于登陆状态, true:登陆,false:登出

  - 返回: 
  - 设备登陆状态        
-  

getLastLoginTime

public int getLastLoginTime()

获取设备最近一次登陆时间,单位-秒

  - 返回:        
-  

getFlag

public int getFlag()

默认为0,1表示该设备被当前登录设备踢出

  - 返回:        
-  

toJson

public java.lang.String toJson()

将对象转换为Json字符串,使用fromJson(String)转换回来

  - 返回: 
  - json格式的String 
  - 从以下版本开始: 
  - 2.6.1        
-  

collectionToJson

public static java.lang.String collectionToJson(java.util.Collection<DeviceInfo> deviceInfos)

将DeviceInfo对象的集合类转换为Json字符串,使用fromJsonToCollection(String)转换回来

  - 参数: 
  - <code>deviceInfos</code> -  
  - 返回: 
  - json格式的字符串 
  - 从以下版本开始: 
  - 2.6.1        
-  

fromJson

public static DeviceInfo fromJson(java.lang.String jsonString)

从Json字符串转换成DeviceInfo对象,转换失败返回null

  - 参数: 
  - <code>jsonString</code> -  
  - 返回: 
  - DeviceInfo,失败返回null 
  - 从以下版本开始: 
  - 2.6.0        
-  

fromJsonToCollection

public static java.util.Collection<DeviceInfo> fromJsonToCollection(java.lang.String jsonString)

从Json字符串转换成Collection对象,方便DeviceInfo的集合类的转换,转换失败返回null

  - 参数: 
  - <code>jsonString</code> -  
  - 返回: 
  - Collection,失败返回null 
  - 从以下版本开始: 
  - 2.6.0       

跳过导航链接