[#BloombergLP-ball-RuleSet-addRule] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/ball.adoc[ball]::xref:BloombergLP/ball/RuleSet.adoc[RuleSet]::addRule :relfileprefix: ../../../ :mrdocs: Create a new `Rule` object having the specified `value`. Return the non‐negative id of this non‐modifiable object on success, and a negative value otherwise. A return value of ‐1 indicates that another rule having this value already exists. A return value of ‐2 indicates that the maximum number of rules for this rule set has been reached. == Synopsis Declared in `<ball_ruleset.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- int addRule(xref:BloombergLP/ball/Rule.adoc[Rule] const& value); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#