鴻蒙OS SequenceUuid

2022-09-01 10:16 更新

SequenceUuid

java.lang.Object

|---ohos.utils.SequenceUuid

public class SequenceUuid
extends Object
implements Sequenceable

封裝通用唯一標(biāo)識符 (UUID) 對象,以便將 SequenceUuid 對象轉(zhuǎn)換為 Parcel 對象,反之亦然。

嵌套類摘要

從接口 ohos.utils.Sequenceable 繼承的嵌套類/接口
Sequenceable.ProducerT

字段摘要

修飾符和類型 字段 描述
static Sequenceable.ProducerSequenceUuid PRODUCER 指示用于創(chuàng)建 SequenceUuid 實例的靜態(tài)公共成員。

構(gòu)造函數(shù)摘要

構(gòu)造函數(shù) 描述
SequenceUuid() 用于創(chuàng)建空 SequenceUuid 對象的構(gòu)造函數(shù)。
SequenceUuid(UUID uuid) 用于創(chuàng)建具有指定 UUID 的 SequenceUuid 對象的構(gòu)造函數(shù)。

方法總結(jié)

修飾符和類型 方法 描述
boolean equals(Object obj) 檢查給定對象是否與當(dāng)前 SequenceUuid 對象相同。
UUID getUuid() 獲取封裝在當(dāng)前 SequenceUuid 對象中的 UUID 對象。
int hashCode() 獲取當(dāng)前 SequenceUuid 對象的哈希碼。
boolean marshalling(Parcel out) 將當(dāng)前 SequenceUuid 對象編組到指定的 Parcel 對象。
String toString() 獲取封裝在當(dāng)前 SequenceUuid 對象中的 UUID 對象的字符串表示形式。
boolean unmarshalling(Parcel in) 從指定的 Parcel 對象中解組當(dāng)前的 SequenceUuid 對象。
static SequenceUuid uuidFromString(String uuid) 使用指定的 UUID 字符串創(chuàng)建一個 SequenceUuid 對象。
從類 java.lang.Object 繼承的方法
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
從接口 ohos.utils.Sequenceable 繼承的方法
hasFileDescriptor

字段詳細(xì)信息

PRODUCER

public static final Sequenceable.ProducerSequenceUuid PRODUCER

指示用于創(chuàng)建 SequenceUuid 實例的靜態(tài)公共成員。

構(gòu)造函數(shù)詳細(xì)信息

SequenceUuid

public SequenceUuid()

用于創(chuàng)建空 SequenceUuid 對象的構(gòu)造函數(shù)。

SequenceUuid

public SequenceUuid(UUID uuid)

用于創(chuàng)建具有指定 UUID 的 SequenceUuid 對象的構(gòu)造函數(shù)。

參數(shù):

參數(shù)名稱 參數(shù)描述
uuid 指示要在 SequenceUuid 對象中設(shè)置的 UUID 對象。

方法詳情

uuidFromString

public static SequenceUuid uuidFromString(String uuid)

使用指定的 UUID 字符串創(chuàng)建一個 SequenceUuid 對象。

參數(shù):

參數(shù)名稱 參數(shù)描述
uuid 指示用于創(chuàng)建 SequenceUuid 對象的符合格式的 UUID 字符串。

返回:

返回一個 SequenceUuid 對象。

Throws:

Throw名稱 Throw描述
IllegalArgumentException 如果字符串不符合 toString 中描述的字符串表示,則拋出此異常。

getUuid

public UUID getUuid()

獲取封裝在當(dāng)前 SequenceUuid 對象中的 UUID 對象。

返回:

返回封裝在當(dāng)前 SequenceUuid 對象中的 UUID 對象。

toString

public String toString()

獲取封裝在當(dāng)前 SequenceUuid 對象中的 UUID 對象的字符串表示形式。

覆蓋:

類 Object 中的 toString

返回:

返回封裝在當(dāng)前 SequenceUuid 對象中的 UUID 對象的字符串表示形式。

hashCode

public int hashCode()

獲取當(dāng)前 SequenceUuid 對象的哈希碼。

覆蓋:

類 Object 中的 hashCode

返回:

返回當(dāng)前 SequenceUuid 對象的哈希碼。

equals

public boolean equals(Object obj)

檢查給定對象是否與當(dāng)前 SequenceUuid 對象相同。

覆蓋:

類 Object 中的等于

參數(shù):

參數(shù)名稱 參數(shù)描述
obj 指示要與當(dāng)前 SequenceUuid 對象進行比較的對象。

返回:

如果兩個對象相同,則返回 true; 否則返回 false。

marshalling

public boolean marshalling(Parcel out)

將當(dāng)前 SequenceUuid 對象編組到指定的 Parcel 對象。

指定者:

接口 Sequenceable 中的編組

參數(shù):

參數(shù)名稱 參數(shù)描述
out 指示用于編組的 Parcel 對象。

返回:

如果編組成功,則返回 true; 否則返回 false。

unmarshalling

public boolean unmarshalling(Parcel in)

從指定的 Parcel 對象中解組當(dāng)前的 SequenceUuid 對象。

指定者:

在接口 Sequenceable 中解組

參數(shù):

參數(shù)名稱 參數(shù)描述
in 指示用于解組的 Parcel 對象。

返回:

如果解組成功,則返回 true; 否則返回 false。

以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號