文档管理中心
API参考HMS Core SDK BaseClass SummaryScope

Scope

展开

Class Info

public class Scope implements IMessageEntity, Parcelable

描述一个OAuth 2.0的请求授权,对用户安全有影响,当请求授权时,会产生一个授权对话框。

Public Constructor Summary

展开

Constructor Name

public Scope()

默认的构造方法,创建一个新的Scope。

public Scope(String scopeUri)

使用指定URI创建一个新的Scope。

Public Method Summary

展开

Qualifier and Type

Method Name

String

getScopeUri()

获取当前Scope对应的授权URI。

boolean

equals(Object o)

判断两个实例是否相等。

int

describeContents()

该方法在序列化和反序列化时使用。

void

writeToParcel(Parcel parcel, int i)

该方法在序列化和反序列化时使用。

int

hashCode()

重写java.lang.Object基类方法,计算Scope对象的hashCode。

String

toString()

重写java.lang.Object基类方法,转换为字符串。

Public Constructors

Scope

展开

Constructor Name

public Scope()

默认的构造方法,创建一个新的Scope。

Scope(String scopeUri)

展开

Constructor Name

public Scope(String scopeUri)

使用指定URI创建一个新的Scope。

Parameters

展开

Name

Type

Constraint

Description

scopeUri

String

Y

授权资源的URI。

scopeUri样例描述:

  • profile:华为帐号的基本信息,例如头像、昵称等
  • email:华为帐号的email
  • openid:华为帐号的openid
  • https://www.huawei.com/auth/games:游戏的专用Scope

Public Methods

getScopeUri

展开

Method

public String getScopeUri()

获取当前Scope对应的授权URI。

Returns

展开

Type

Description

String

返回当前Scope对应的授权URI。

equals

展开

Method

public boolean equals(Object o)

判断两个实例是否相等。

Parameters

展开

Name

Type

Constraint

Description

o

Object

Y

待比较的对象。

Returns

展开

Type

Description

boolean

true表示两个Scope相同。false表示两个Scope不同。

describeContents

展开

Method

public int describeContents()

该方法在序列化和反序列化时使用。

Returns

展开

Type

Description

int

返回0。

writeToParcel

展开

Method

public void writeToParcel(Parcel parcel, int i)

该方法在序列化和反序列化时使用。

Parameters

展开

Name

Type

Constraint

Description

parcel

Parcel

Y

parcel对象。

i

int

Y

标记。

hashCode

展开

Method

public final int hashCode()

重写java.lang.Object基类方法,计算Scope对象的hashCode。

Returns

展开

Type

Description

int

hash code值。

toString

展开

Method

public final String toString()

重写java.lang.Object基类方法,转换为字符串。

Returns

展开

Type

Description

String

转换后的字符串。

在 API参考 中进行搜索
请输入您想要搜索的关键词