Class VaultQuery
java.lang.Object
org.springframework.vault.repository.query.VaultQuery
Vault query consisting of a single
Predicate
. A new (empty) query evaluates
unconditionally to true and can be composed using and(VaultQuery)
and or(VaultQuery)
.
A query can express predicates only against the
Id
field of a SecretDocument
.- Since:
- 2.0
- Author:
- Mark Paluch
-
Constructor Summary
ConstructorDescriptionCreate a newVaultQuery
that evaluates unconditionally to true.VaultQuery
(Predicate<String> predicate) Create a newVaultQuery
givenPredicate
. -
Method Summary
Modifier and TypeMethodDescriptionand
(VaultQuery other) or
(VaultQuery other) boolean
Evaluate the query against aString
.boolean
test
(SecretDocument document) Evaluate the query against aSecretDocument
.
-
Constructor Details
-
VaultQuery
public VaultQuery()Create a newVaultQuery
that evaluates unconditionally to true. -
VaultQuery
Create a newVaultQuery
givenPredicate
.- Parameters:
predicate
- must not be null.
-
-
Method Details
-
test
Evaluate the query against aSecretDocument
.- Parameters:
document
- must not be null.- Returns:
- true if the predicate matches, false otherwise.
-
test
Evaluate the query against aString
.- Parameters:
id
- must not be null.- Returns:
- true if the predicate matches, false otherwise.
-
and
- Parameters:
other
- must not be null.- Returns:
- a new composed
VaultQuery
. - See Also:
-
and
- Parameters:
predicate
- must not be null.- Returns:
- a new composed
VaultQuery
. - See Also:
-
or
- Parameters:
other
- must not be null.- Returns:
- a new composed
VaultQuery
. - See Also:
-
getPredicate
- Returns:
- the underlying predicate.
-