Package org.forgerock.secrets.vault
Interface VaultKeyValueSecretStore.SecretFieldDecoder
- All Superinterfaces:
BiFunction<SecretBuilder,
JsonValue, Promise<SecretBuilder, NoSuchSecretException>>
- All Known Implementing Classes:
VaultKeyValueSecretStore.SecretField
- Enclosing class:
- VaultKeyValueSecretStore
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public static interface VaultKeyValueSecretStore.SecretFieldDecoder
extends BiFunction<SecretBuilder,JsonValue,Promise<SecretBuilder,NoSuchSecretException>>
Determines how a field in the Vault JSON response should be decoded into one or more fields on a
SecretBuilder
object. See VaultKeyValueSecretStore.SecretField
for standard implementations.-
Method Summary
Modifier and TypeMethodDescriptionapply
(SecretBuilder secretBuilder, JsonValue jsonValue) Decodes a JSON value into one or more fields on aSecretBuilder
.Methods inherited from interface java.util.function.BiFunction
andThen
-
Method Details
-
apply
Promise<SecretBuilder,NoSuchSecretException> apply(SecretBuilder secretBuilder, JsonValue jsonValue) Decodes a JSON value into one or more fields on aSecretBuilder
. The function will be passed theJsonValue
corresponding to the data element in the response (if it exists) and should return a modified copy of the secret builder with fields set from the data.- Specified by:
apply
in interfaceBiFunction<SecretBuilder,
JsonValue, Promise<SecretBuilder, NoSuchSecretException>> - Parameters:
secretBuilder
- the secret builder to populate.jsonValue
- the JSON value to process.- Returns:
- a promise for a new secret builder or an exception if the data cannot be processed.
-