1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use crate::wrapper::or_chain::OrChain;
use crate::wrapper::tag::Tag;

#[derive(Debug)]
pub struct OrChainBuilder {
    tags: Vec<Tag>,
}

impl OrChainBuilder {
    pub fn new() -> Self {
        Self { tags: Vec::new() }
    }

    /// Adds a tag to the or expression
    pub fn add_tag(mut self, tag: Tag) -> Self {
        self.tags.push(tag);
        self
    }

    /// Adds multiple tags to the or expression
    pub fn add_tags(mut self, mut tags: Vec<Tag>) -> Self {
        self.tags.append(&mut tags);
        self
    }

    /// Builds the or chain
    pub fn build(self) -> OrChain {
        OrChain::new(self.tags)
    }
}