UserStyleSetting.Option.Id


public final class UserStyleSetting.Option.Id


Machine readable identifier for Options. The length of this identifier may not exceed MAX_LENGTH.

Summary

Constants

static final int
MAX_LENGTH = 1024

Maximum length of the value field to ensure acceptable companion editing latency.

Public constructors

Id(@NonNull byte[] value)
Id(@NonNull String value)

Constructs an Id with a String encoded to a ByteArray by String.encodeToByteArray.

Public methods

boolean
equals(Object other)
final @NonNull byte[]

The ByteArray value of this Id.

int
@NonNull String

Constants

MAX_LENGTH

public static final int MAX_LENGTH = 1024

Maximum length of the value field to ensure acceptable companion editing latency. Please note the UserStyleSchema and the UserStyleSetting are sent over bluetooth to the companion phone when editing, and that bandwidth is limited (2mbps is common). Best practice is to keep these Ids short, ideally under 10 bytes.

Note the UserStyle has a maximum size (UserStyle.MAXIMUM_SIZE_BYTES) and that Option Ids are a significant contributor to the overall size of a UserStyle.

Public constructors

Id

Added in 1.0.0
public Id(@NonNull byte[] value)
Parameters
@NonNull byte[] value

The ByteArray value of this Id.

Id

Added in 1.0.0
public Id(@NonNull String value)

Constructs an Id with a String encoded to a ByteArray by String.encodeToByteArray.

Public methods

equals

public boolean equals(Object other)

getValue

Added in 1.0.0
public final @NonNull byte[] getValue()

The ByteArray value of this Id.

hashCode

public int hashCode()

toString

public @NonNull String toString()