Class Policy
java.lang.Object
org.springframework.vault.support.Policy
Value object representing a Vault policy associated with
Policy.Rules. Instances of
Policy support JSON serialization and deserialization using Jackson.- Since:
- 2.0
- Author:
- Mark Paluch
- See Also:
-
Policy.RuleObjectMapper
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumBuilt-in Vault capabilities.static interfaceCapability interface representing capability literals.static classValue object representing a rule for a certain path. -
Method Summary
Modifier and TypeMethodDescriptionstatic Policyempty()Create an emptyPolicywithout rules.booleanLookup aPolicy.Ruleby its path.getRules()inthashCode()static Policyof(Set<Policy.Rule> rules) Create aPolicyfrom one or morerules.static Policyof(Policy.Rule... rules) Create aPolicyfrom one or morerules.with(Policy.Rule rule) Create a newPolicyobject containing all configured rules and add the givenPolicy.Ruleto the new policy object.
-
Method Details
-
empty
Create an emptyPolicywithout rules.- Returns:
- an empty
Policy.
-
of
Create aPolicyfrom one or morerules.- Parameters:
rules- must not be null.- Returns:
- the
Policyobject containingrules.
-
of
Create aPolicyfrom one or morerules.- Parameters:
rules- must not be null.- Returns:
- the
Policyobject containingrules.
-
with
Create a newPolicyobject containing all configured rules and add the givenPolicy.Ruleto the new policy object. If the givenPolicy.Rulematches an existing rule path, the exiting rule will be overridden by the new rule object.- Parameters:
rule- must not be null.- Returns:
- the new
Policyobject containing all configured rules and the givenPolicy.Rule.
-
getRules
-
getRule
Lookup aPolicy.Ruleby its path. Returns null if the rule was not found.- Parameters:
path- must not be null.- Returns:
- the
Policy.Ruleor null, if not found.
-
equals
-
hashCode
public int hashCode()
-