@Contract
public interface PasswordAliasStore
If the implementation holds the aliases and passwords in memory, it handles loading and saving the in-memory contents from and to persistent storage, at the discretion of the implementer. For example, loading would typically happen when the password alias store implementation is first instantiated, although an implementation could choose to load lazily on first read. Saving is at the discretion of the implementer as well, although to maximize reliability the implementation should persist changes as they occur. The {@link #putAll ) methods can help optimize that.
Modifier and Type | Method and Description |
---|---|
void |
clear()
Deletes all password aliases from the store.
|
boolean |
containsKey(String alias)
Reports whether the store contains the specified alias.
|
char[] |
get(String alias)
Returns the password associated with the specified alias.
|
boolean |
isEmpty()
Reports whether the alias store is empty.
|
Iterator<String> |
keys()
Returns an Iterator over aliases present in the alias store.
|
void |
put(String alias,
char[] password)
Insert a new alias with the specified password, or assigns a new
password to an existing alias.
|
void |
putAll(Map<String,char[]> settings)
Adds a group of alias/password pairs in a single operation.
|
void |
putAll(PasswordAliasStore otherStore)
Adds all alias/password pairs from the specified store to this store.
|
void |
remove(String alias)
Removes the specified alias (and the associated password) from the
password alias store.
|
int |
size()
Reports the number of aliases present in the store.
|
boolean containsKey(String alias)
alias
- the alias to check forchar[] get(String alias)
alias
- the alias of interestboolean isEmpty()
int size()
void clear()
void put(String alias, char[] password)
alias
- the alias to create or reassignpassword
- the password to be associated with the aliasvoid putAll(PasswordAliasStore otherStore)
otherStore
- the alias store from which to get entriesvoid putAll(Map<String,char[]> settings)
Callers might prefer to invoke this method once rather than invoking {@link #put ) repeatedly, for example if an implementation persists each change as it is made.
settings
- the alias/password pairs to addvoid remove(String alias)
alias
- the alias to be removedCopyright © 2021. All rights reserved.