public class Rules extends Object
| Constructor and Description |
|---|
Rules()
Default constructor that creates an empty rule list.
|
Rules(DarcProto.Rules rules)
Constructor for the protobuf representation.
|
Rules(Rules other)
This is the copy constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addRule(String a,
byte[] expr)
Adds a rule.
|
boolean |
contains(String a)
Checks whether a rule exists.
|
Rule |
get(String a)
Gets a rule, if it does not exist then null is returned.
|
List<String> |
getAllActions()
Gets all the actions as a List.
|
List<Rule> |
getAllRules()
Gets all rules as a List.
|
Rule |
remove(String a)
Removes the action if it exists.
|
DarcProto.Rules |
toProto()
Converts the rule to its protobuf representation.
|
void |
updateRule(String a,
byte[] expr)
Updates a rule.
|
public static final String OR
public static final String AND
public Rules()
public Rules(Rules other)
other - public Rules(DarcProto.Rules rules)
rules - public void addRule(String a, byte[] expr) throws CothorityAlreadyExistsException
a - is the actionexpr - is the expressionCothorityAlreadyExistsExceptionpublic void updateRule(String a, byte[] expr) throws CothorityNotFoundException
a - is the actionexpr - is the expressionCothorityNotFoundExceptionpublic Rule get(String a)
a - is the actionpublic Rule remove(String a)
a - is the actionpublic boolean contains(String a)
a - is the actionpublic DarcProto.Rules toProto()
Copyright © 2018. All rights reserved.