AdTechIdentifier
public final class AdTechIdentifier
extends Object
implements Parcelable
java.lang.Object | |
↳ | android.adservices.common.AdTechIdentifier |
表示广告买家或卖家的标识符。
摘要
继承的常量 |
---|
字段 | |
---|---|
public static final Creator<AdTechIdentifier> |
CREATOR
|
公共方法 | |
---|---|
int
|
describeContents()
描述此 Parcelable 实例的封送表示中包含的特殊对象的种类。 |
boolean
|
equals(Object o)
将此 AdTechIdentifier 与指定对象进行比较。 |
static AdTechIdentifier
|
fromString(String source)
从 String 构造此类的实例。 |
int
|
hashCode()
返回通过调用 |
String
|
toString()
返回对象的字符串表示形式。 |
void
|
writeToParcel(Parcel dest, int flags)
将此对象展平到 Parcel 中。 |
继承的方法 | |
---|---|
字段
CREATOR
public static final Creator<AdTechIdentifier> CREATOR
公共方法
describeContents
public int describeContents ()
描述此 Parcelable 实例的封送表示中包含的特殊对象的种类。例如,如果对象在 writeToParcel(android.os.Parcel, int)
的输出中包含文件描述符,则此方法的返回值必须包含 CONTENTS_FILE_DESCRIPTOR
位。
返回值 | |
---|---|
int |
指示此 Parcelable 对象实例封送的特殊对象类型集合的位掩码。值为 0 或 CONTENTS_FILE_DESCRIPTOR |
equals
public boolean equals (Object o)
将此 AdTechIdentifier 与指定对象进行比较。仅当参数非空且是与此 AdTechIdentifier 字符串形式相同(通过调用 toString()
获取)的 AdTechIdentifier 对象时,结果才为 true。请注意,此方法不会执行任何 eTLD+1 规范化,因此,如果两个具有相同 eTLD+1 的 AdTechIdentifier 对象的 String 表示形式不同,则它们可能不相等。
参数 | |
---|---|
o |
Object :用于与此 AdTechIdentifier 进行比较的对象 |
返回值 | |
---|---|
boolean |
如果给定对象表示与此 AdTechIdentifier 等效的 AdTechIdentifier,则为 true,否则为 false |
fromString
public static AdTechIdentifier fromString (String source)
从 String 构造此类的实例。
参数 | |
---|---|
source |
String :广告买家或卖家的有效 eTLD+1 域,或 null。 |
返回值 | |
---|---|
AdTechIdentifier |
包装给定域的 AdTechIdentifier 类;如果输入为 null,则为 null。 |
hashCode
public int hashCode ()
返回通过调用 toString()
获取的此类的字符串表示形式对应的哈希码。请注意,此方法不会执行任何 eTLD+1 规范化,因此,如果底层字符串表示形式不同,两个具有相同 eTLD+1 的 AdTechIdentifier 对象可能具有不同的哈希码。
返回值 | |
---|---|
int |
此对象的哈希码值。 |
toString
public String toString ()
返回对象的字符串表示形式。通常,toString
方法会返回一个“以文本形式表示”此对象的字符串。结果应为简洁但信息丰富的表示形式,便于阅读。建议所有子类重写此方法。
Object 类的 toString
方法返回一个字符串,该字符串由对象所属类的名称、at 符号字符 `@
' 和对象哈希码的无符号十六进制表示形式组成。换句话说,此方法返回一个等于以下值的字符串:
getClass().getName() + '@' + Integer.toHexString(hashCode())
返回值 | |
---|---|
String |
String 形式的标识符。此值不能为 null 。 |
writeToParcel
public void writeToParcel (Parcel dest, int flags)
将此对象展平到 Parcel 中。
参数 | |
---|---|
dest |
Parcel :此值不能为 null 。 |
flags |
int :有关如何写入对象的附加标志。可以为 0 或 Parcelable.PARCELABLE_WRITE_RETURN_VALUE 。值为 0 或 Parcelable.PARCELABLE_WRITE_RETURN_VALUE 和 android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES 的组合 |