PersonalizationData.Builder


class PersonalizationData.Builder


A builder for PersonalizationData.

Summary

Public constructors

Creates a new builder for a given namespace.

Public functions

PersonalizationData.Builder

Adds a new access control profile to the builder.

PersonalizationData

Creates a new PersonalizationData with all the entries added to the builder.

PersonalizationData.Builder
putEntry(
    namespace: String,
    name: String,
    accessControlProfileIds: (Mutable)Collection<AccessControlProfileId!>,
    value: ByteArray
)

Adds a new entry to the builder.

PersonalizationData.Builder
putEntryBoolean(
    namespace: String,
    name: String,
    accessControlProfileIds: (Mutable)Collection<AccessControlProfileId!>,
    value: Boolean
)

Adds a new entry to the builder.

PersonalizationData.Builder
putEntryBytestring(
    namespace: String,
    name: String,
    accessControlProfileIds: (Mutable)Collection<AccessControlProfileId!>,
    value: ByteArray
)

Adds a new entry to the builder.

PersonalizationData.Builder
putEntryCalendar(
    namespace: String,
    name: String,
    accessControlProfileIds: (Mutable)Collection<AccessControlProfileId!>,
    value: Calendar
)

Adds a new entry to the builder.

PersonalizationData.Builder
putEntryInteger(
    namespace: String,
    name: String,
    accessControlProfileIds: (Mutable)Collection<AccessControlProfileId!>,
    value: Long
)

Adds a new entry to the builder.

PersonalizationData.Builder
putEntryString(
    namespace: String,
    name: String,
    accessControlProfileIds: (Mutable)Collection<AccessControlProfileId!>,
    value: String
)

Adds a new entry to the builder.

Public constructors

Builder

Added in 1.0.0-alpha04
Builder()

Creates a new builder for a given namespace.

Public functions

addAccessControlProfile

Added in 1.0.0-alpha04
fun addAccessControlProfile(profile: AccessControlProfile): PersonalizationData.Builder

Adds a new access control profile to the builder.

Parameters
profile: AccessControlProfile

The access control profile.

Returns
PersonalizationData.Builder

The builder.

build

Added in 1.0.0-alpha04
fun build(): PersonalizationData

Creates a new PersonalizationData with all the entries added to the builder.

Returns
PersonalizationData

A new PersonalizationData instance.

putEntry

Added in 1.0.0-alpha04
fun putEntry(
    namespace: String,
    name: String,
    accessControlProfileIds: (Mutable)Collection<AccessControlProfileId!>,
    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 or putEntryInteger 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: (Mutable)Collection<AccessControlProfileId!>

A set of access control profiles to use.

value: ByteArray

The value to add, in CBOR encoding.

Returns
PersonalizationData.Builder

The builder.

putEntryBoolean

Added in 1.0.0-alpha04
fun putEntryBoolean(
    namespace: String,
    name: String,
    accessControlProfileIds: (Mutable)Collection<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. 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: (Mutable)Collection<AccessControlProfileId!>

A set of access control profiles to use.

value: Boolean

The value to add.

Returns
PersonalizationData.Builder

The builder.

putEntryBytestring

Added in 1.0.0-alpha04
fun putEntryBytestring(
    namespace: String,
    name: String,
    accessControlProfileIds: (Mutable)Collection<AccessControlProfileId!>,
    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. 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: (Mutable)Collection<AccessControlProfileId!>

A set of access control profiles to use.

value: ByteArray

The value to add.

Returns
PersonalizationData.Builder

The builder.

putEntryCalendar

Added in 1.0.0-alpha04
fun putEntryCalendar(
    namespace: String,
    name: String,
    accessControlProfileIds: (Mutable)Collection<AccessControlProfileId!>,
    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. 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: (Mutable)Collection<AccessControlProfileId!>

A set of access control profiles to use.

value: Calendar

The value to add.

Returns
PersonalizationData.Builder

The builder.

putEntryInteger

Added in 1.0.0-alpha04
fun putEntryInteger(
    namespace: String,
    name: String,
    accessControlProfileIds: (Mutable)Collection<AccessControlProfileId!>,
    value: Long
): 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. The resulting CBOR will be major type 0 (unsigned integer) if non-negative, otherwise major type 1 (negative integer).

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: (Mutable)Collection<AccessControlProfileId!>

A set of access control profiles to use.

value: Long

The value to add.

Returns
PersonalizationData.Builder

The builder.

putEntryString

Added in 1.0.0-alpha04
fun putEntryString(
    namespace: String,
    name: String,
    accessControlProfileIds: (Mutable)Collection<AccessControlProfileId!>,
    value: String
): 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. The resulting CBOR will be major type 3 (text string).

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: (Mutable)Collection<AccessControlProfileId!>

A set of access control profiles to use.

value: String

The value to add.

Returns
PersonalizationData.Builder

The builder.