Builder
class Builder
kotlin.Any | |
↳ | androidx.security.identity.PersonalizationData.Builder |
A builder for PersonalizationData
.
Summary
Public constructors | |
---|---|
<init>() Creates a new builder for a given namespace. |
Public methods | |
---|---|
PersonalizationData.Builder |
addAccessControlProfile(@NonNull profile: AccessControlProfile) Adds a new access control profile to the builder. |
PersonalizationData |
build() Creates a new |
PersonalizationData.Builder |
putEntry(@NonNull namespace: String, @NonNull name: String, @NonNull accessControlProfileIds: MutableCollection<AccessControlProfileId!>, @NonNull value: ByteArray) Adds a new entry to the builder. |
PersonalizationData.Builder |
putEntryBoolean(@NonNull namespace: String, @NonNull name: String, @NonNull accessControlProfileIds: MutableCollection<AccessControlProfileId!>, value: Boolean) Adds a new entry to the builder. |
PersonalizationData.Builder |
putEntryBytestring(@NonNull namespace: String, @NonNull name: String, @NonNull accessControlProfileIds: MutableCollection<AccessControlProfileId!>, @NonNull value: ByteArray) Adds a new entry to the builder. |
PersonalizationData.Builder |
putEntryCalendar(@NonNull namespace: String, @NonNull name: String, @NonNull accessControlProfileIds: MutableCollection<AccessControlProfileId!>, @NonNull value: Calendar) Adds a new entry to the builder. |
PersonalizationData.Builder |
putEntryInteger(@NonNull namespace: String, @NonNull name: String, @NonNull accessControlProfileIds: MutableCollection<AccessControlProfileId!>, value: Long) Adds a new entry to the builder. |
PersonalizationData.Builder |
putEntryString(@NonNull namespace: String, @NonNull name: String, @NonNull accessControlProfileIds: MutableCollection<AccessControlProfileId!>, @NonNull value: String) Adds a new entry to the builder. |
Public constructors
<init>
Builder()
Creates a new builder for a given namespace.
Public methods
addAccessControlProfile
@NonNull fun addAccessControlProfile(@NonNull profile: AccessControlProfile): PersonalizationData.Builder
Adds a new access control profile to the builder.
Parameters | |
---|---|
profile |
AccessControlProfile: The access control profile. |
Return | |
---|---|
PersonalizationData.Builder |
The builder. |
build
@NonNull fun build(): PersonalizationData
Creates a new PersonalizationData
with all the entries added to the builder.
Return | |
---|---|
PersonalizationData |
A new PersonalizationData instance. |
putEntry
@NonNull fun putEntry(
@NonNull namespace: String,
@NonNull name: String,
@NonNull accessControlProfileIds: MutableCollection<AccessControlProfileId!>,
@NonNull value: ByteArray
): PersonalizationData.Builder
Adds a new entry to the builder.
This is a low-level method which expects the data to be the bytes of a CBOR value. When possible, applications should use methods such as putEntryString(String, String, Collection, String)
or putEntryInteger(String, String, Collection, long)
which accept normal Java data types.
Parameters | |
---|---|
namespace |
String: The namespace to use, e.g. org.iso.18013-5.2019 . |
name |
String: The name of the entry, e.g. height . |
accessControlProfileIds |
MutableCollection<AccessControlProfileId!>: A set of access control profiles to use. |
value |
ByteArray: The value to add, in CBOR encoding. |
Return | |
---|---|
PersonalizationData.Builder |
The builder. |
putEntryBoolean
@NonNull fun putEntryBoolean(
@NonNull namespace: String,
@NonNull name: String,
@NonNull accessControlProfileIds: MutableCollection<AccessControlProfileId!>,
value: Boolean
): PersonalizationData.Builder
Adds a new entry to the builder.
This is a convenience method which encodes value
as CBOR and adds the resulting bytes using putEntry(String, String, Collection, byte[])
. The resulting CBOR will be major type 7 (simple value) with additional information 20 (for the value false
) or 21 (for the value true
).
Parameters | |
---|---|
namespace |
String: The namespace to use, e.g. org.iso.18013-5.2019 . |
name |
String: The name of the entry, e.g. height . |
accessControlProfileIds |
MutableCollection<AccessControlProfileId!>: A set of access control profiles to use. |
value |
Boolean: The value to add. |
Return | |
---|---|
PersonalizationData.Builder |
The builder. |
putEntryBytestring
@NonNull fun putEntryBytestring(
@NonNull namespace: String,
@NonNull name: String,
@NonNull accessControlProfileIds: MutableCollection<AccessControlProfileId!>,
@NonNull value: ByteArray
): PersonalizationData.Builder
Adds a new entry to the builder.
This is a convenience method which encodes value
as CBOR and adds the resulting bytes using putEntry(String, String, Collection, byte[])
. The resulting CBOR will be major type 2 (bytestring).
Parameters | |
---|---|
namespace |
String: The namespace to use, e.g. org.iso.18013-5.2019 . |
name |
String: The name of the entry, e.g. height . |
accessControlProfileIds |
MutableCollection<AccessControlProfileId!>: A set of access control profiles to use. |
value |
ByteArray: The value to add. |
Return | |
---|---|
PersonalizationData.Builder |
The builder. |
putEntryCalendar
@NonNull fun putEntryCalendar(
@NonNull namespace: String,
@NonNull name: String,
@NonNull accessControlProfileIds: MutableCollection<AccessControlProfileId!>,
@NonNull value: Calendar
): PersonalizationData.Builder
Adds a new entry to the builder.
This is a convenience method which encodes value
as CBOR and adds the resulting bytes using putEntry(String, String, Collection, byte[])
. The resulting CBOR will be a tagged string with tag 0 as per Section 2.4.1 of RFC 7049. This means that the tagged string follows the standard format described in RFC 3339, as refined by Section 3.3 of RFC 4287>.
Parameters | |
---|---|
namespace |
String: The namespace to use, e.g. org.iso.18013-5.2019 . |
name |
String: The name of the entry, e.g. height . |
accessControlProfileIds |
MutableCollection<AccessControlProfileId!> |