目录

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

[h2]Scope

Constructor Name

public Scope()

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

[h2]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

[h2]getScopeUri

Method

public String getScopeUri()

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

Returns

Type

Description

String

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

[h2]equals

Method

public boolean equals(Object o)

判断两个实例是否相等。

Parameters

Name

Type

Constraint

Description

o

Object

Y

待比较的对象。

Returns

Type

Description

boolean

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

[h2]describeContents

Method

public int describeContents()

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

Returns

Type

Description

int

返回0。

[h2]writeToParcel

Method

public void writeToParcel(Parcel parcel, int i)

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

Parameters

Name

Type

Constraint

Description

parcel

Parcel

Y

parcel对象。

i

int

Y

标记。

[h2]hashCode

Method

public final int hashCode()

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

Returns

Type

Description

int

hash code值。

[h2]toString

Method

public final String toString()

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

Returns

Type

Description

String

转换后的字符串。