nullnet_libdatastore/builders/
multiple_sort_builder.rs

1use crate::datastore::MultipleSort;
2
3#[derive(Debug, Default)]
4pub struct MultipleSortBuilder {
5    by_field: String,
6    by_direction: String,
7    is_case_sensitive_sorting: bool,
8}
9
10impl MultipleSortBuilder {
11    pub fn new() -> Self {
12        Self::default()
13    }
14
15    pub fn by_field(mut self, value: impl Into<String>) -> Self {
16        self.by_field = value.into();
17        self
18    }
19
20    pub fn by_direction(mut self, value: impl Into<String>) -> Self {
21        self.by_direction = value.into();
22        self
23    }
24
25    pub fn case_sensitive_sorting(mut self, value: bool) -> Self {
26        self.is_case_sensitive_sorting = value;
27        self
28    }
29
30    pub fn build(self) -> MultipleSort {
31        MultipleSort {
32            by_field: self.by_field,
33            by_direction: self.by_direction,
34            is_case_sensitive_sorting: self.is_case_sensitive_sorting,
35        }
36    }
37}