dis_rs/common/data_query_r/
builder.rs1use crate::common::model::EntityId;
2use crate::data_query_r::model::DataQueryR;
3use crate::enumerations::{RequiredReliabilityService, VariableRecordType};
4
5pub struct DataQueryRBuilder(DataQueryR);
6
7impl Default for DataQueryRBuilder {
8    fn default() -> Self {
9        Self::new()
10    }
11}
12
13impl DataQueryRBuilder {
14    #[must_use]
15    pub fn new() -> Self {
16        DataQueryRBuilder(DataQueryR::default())
17    }
18
19    #[must_use]
20    pub fn new_from_body(body: DataQueryR) -> Self {
21        DataQueryRBuilder(body)
22    }
23
24    #[must_use]
25    pub fn build(self) -> DataQueryR {
26        self.0
27    }
28
29    #[must_use]
30    pub fn with_origination_id(mut self, originating_id: EntityId) -> Self {
31        self.0.originating_id = originating_id;
32        self
33    }
34
35    #[must_use]
36    pub fn with_receiving_id(mut self, receiving_id: EntityId) -> Self {
37        self.0.receiving_id = receiving_id;
38        self
39    }
40
41    #[must_use]
42    pub fn with_required_reliability_service(
43        mut self,
44        required_reliability_service: RequiredReliabilityService,
45    ) -> Self {
46        self.0.required_reliability_service = required_reliability_service;
47        self
48    }
49
50    #[must_use]
51    pub fn with_request_id(mut self, request_id: u32) -> Self {
52        self.0.request_id = request_id;
53        self
54    }
55
56    #[must_use]
57    pub fn with_time_interval(mut self, time_interval: u32) -> Self {
58        self.0.time_interval = time_interval;
59        self
60    }
61
62    #[must_use]
63    pub fn with_fixed_datums(mut self, fixed_datum_records: Vec<VariableRecordType>) -> Self {
64        self.0.fixed_datum_records = fixed_datum_records;
65        self
66    }
67
68    #[must_use]
69    pub fn with_variable_datums(mut self, variable_datum_records: Vec<VariableRecordType>) -> Self {
70        self.0.variable_datum_records = variable_datum_records;
71        self
72    }
73}