public static final class KeysetHandle.Builder.Entry extends Object
This is the analogue of Keyset.Entry for a builder.
Users will have to ensure that each entry has an ID, and one entry is a primary. See
KeysetHandle.Builder.build() for details).
| Modifier and Type | Method and Description |
|---|---|
KeyStatus |
getStatus()
Returns the status of this entry.
|
boolean |
isPrimary()
Returns whether this entry has been marked as a primary.
|
KeysetHandle.Builder.Entry |
makePrimary()
Marks that this entry is the primary key.
|
KeysetHandle.Builder.Entry |
setStatus(KeyStatus status)
Sets the status of this entry.
|
KeysetHandle.Builder.Entry |
withFixedId(int id)
Tells Tink to assign a fixed id when this keyset is built.
|
KeysetHandle.Builder.Entry |
withRandomId()
Tells Tink to assign an unused uniform random id when this keyset is built.
|
@CanIgnoreReturnValue public KeysetHandle.Builder.Entry makePrimary()
Other entries in the same keyset will be marked as non-primary if this Entry has already been added to a builder, otherwise they will marked as non-primary once this entry is added to a builder.
public boolean isPrimary()
@CanIgnoreReturnValue public KeysetHandle.Builder.Entry setStatus(KeyStatus status)
public KeyStatus getStatus()
@CanIgnoreReturnValue public KeysetHandle.Builder.Entry withFixedId(int id)
@CanIgnoreReturnValue public KeysetHandle.Builder.Entry withRandomId()
Using withRandomId is invalid for an entry with an imported or preexisting key,
which has an ID requirement.
If an entry is marked as withRandomId, all subsequent entries also need to be
marked with withRandomId, or else calling build() will fail.