public class Policy extends Object
Policy.Rule
s. Instances of
Policy
support JSON serialization and deserialization using Jackson.Policy.Rule
,
ObjectMapper
Modifier and Type | Class and Description |
---|---|
static class |
Policy.BuiltinCapabilities
Built-in Vault capabilities.
|
static interface |
Policy.Capability
Capability interface representing capability literals.
|
static class |
Policy.Rule
Value object representing a rule for a certain path.
|
Modifier and Type | Method and Description |
---|---|
static Policy |
empty()
Create an empty
Policy without rules. |
boolean |
equals(Object o) |
Policy.Rule |
getRule(String path)
Lookup a
Policy.Rule by its path. |
Set<Policy.Rule> |
getRules() |
int |
hashCode() |
static Policy |
of(Policy.Rule... rules)
Create a
Policy from one or more rules . |
static Policy |
of(Set<Policy.Rule> rules)
Create a
Policy from one or more rules . |
Policy |
with(Policy.Rule rule)
Create a new
Policy object containing all configured rules and add the
given Policy.Rule to the new policy object. |
public static Policy of(Policy.Rule... rules)
Policy
from one or more rules
.rules
- must not be null.Policy
object containing rules
.public static Policy of(Set<Policy.Rule> rules)
Policy
from one or more rules
.rules
- must not be null.Policy
object containing rules
.public Policy with(Policy.Rule rule)
Policy
object containing all configured rules and add the
given Policy.Rule
to the new policy object. If the given Policy.Rule
matches an
existing rule path, the exiting rule will be overridden by the new rule object.rule
- must not be null.Policy
object containing all configured rules and the given
Policy.Rule
.public Set<Policy.Rule> getRules()
@Nullable public Policy.Rule getRule(String path)
Policy.Rule
by its path. Returns null if the rule was not
found.path
- must not be null.Policy.Rule
or null, if not found.Copyright © 2016–2021 Pivotal Software, Inc.. All rights reserved.