public class VariantDictionary extends Object
Though specific to KDBX V4 it is kept here for convenience of parameter passing to crypto functions
Modifier and Type | Class and Description |
---|---|
static class |
VariantDictionary.Entry |
static class |
VariantDictionary.EntryType
The list of permissible entry types
|
Constructor and Description |
---|
VariantDictionary(short version)
Make a new Variant Dictionary whose version must be 1
|
Modifier and Type | Method and Description |
---|---|
VariantDictionary |
copy()
Make a copy of this structure - Entries are immutable so are copied as is
|
@Nullable VariantDictionary.Entry |
get(@NotNull String key)
Return an entry for the key supplied
|
Map<String,VariantDictionary.Entry> |
getEntries()
get the entries in this dictionary
|
short |
getVersion()
Get the version number of this structure
|
@NotNull VariantDictionary.Entry |
mustGet(@NotNull String key)
ensure that the entry sought is not null, by throwing an illegal argument exception if it is not present
|
void |
put(@NotNull String key,
VariantDictionary.EntryType type,
byte[] value)
Add an entry of the type defined
|
void |
putByteArray(@NotNull String key,
byte[] value)
Put a byte array under the key defined
|
void |
putInt(@NotNull String key,
int value) |
void |
putLong(@NotNull String key,
long value)
Put a long as a signed64 under the key defined
|
void |
putUInt(@NotNull String key,
int value) |
void |
putULong(@NotNull String key,
long value)
Put a long as an unsigned64 under the key defined
|
void |
putUuid(@NotNull String key,
UUID uuid)
Put a UUID under the key defined
|
public VariantDictionary(short version)
public VariantDictionary copy()
public Map<String,VariantDictionary.Entry> getEntries()
public short getVersion()
@Nullable public @Nullable VariantDictionary.Entry get(@NotNull @NotNull String key)
key
- the key@NotNull public @NotNull VariantDictionary.Entry mustGet(@NotNull @NotNull String key)
key
- the key to getpublic void put(@NotNull @NotNull String key, VariantDictionary.EntryType type, byte[] value)
key
- the entry keytype
- the data type of the entryvalue
- a buffer containing an appropriate entrypublic void putUuid(@NotNull @NotNull String key, UUID uuid)
public void putByteArray(@NotNull @NotNull String key, byte[] value)
public void putLong(@NotNull @NotNull String key, long value)
public void putULong(@NotNull @NotNull String key, long value)
public void putInt(@NotNull @NotNull String key, int value)
public void putUInt(@NotNull @NotNull String key, int value)
Copyright © 2023. All rights reserved.