data-modelling-core 2.4.0

Core SDK library for model operations across platforms
Documentation
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
//! Supporting types for ODCS native data structures
//!
//! These types are used across ODCSContract, SchemaObject, and Property
//! to represent shared concepts like quality rules, custom properties, and relationships.

use indexmap::IndexMap;
use serde::{Deserialize, Serialize};
use std::collections::HashMap;

/// Quality rule for data validation (ODCS v3.1.0)
///
/// Quality rules can be defined at contract, schema, or property level.
/// Field order matches the ODCS v3.1.0 JSON schema for stable serialization.
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
#[serde(rename_all = "camelCase")]
pub struct QualityRule {
    // === Identity ===
    /// Stable identifier for the quality rule
    #[serde(skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// Type of quality rule (e.g., "sql", "custom", "library", "text")
    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
    pub rule_type: Option<String>,
    /// Name of the data quality check
    #[serde(skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Quality dimension (e.g., "accuracy", "completeness", "timeliness")
    #[serde(skip_serializing_if = "Option::is_none")]
    pub dimension: Option<String>,
    /// Description of the quality rule
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Consequences of rule failure (e.g., "operational", "regulatory")
    #[serde(skip_serializing_if = "Option::is_none")]
    pub business_impact: Option<String>,
    /// Severity of the quality rule (e.g., "info", "warning", "error")
    #[serde(skip_serializing_if = "Option::is_none")]
    pub severity: Option<String>,
    /// Method of validation (e.g., "reconciliation")
    #[serde(skip_serializing_if = "Option::is_none")]
    pub method: Option<String>,
    /// Unit the rule uses (e.g., "rows", "percent")
    #[serde(skip_serializing_if = "Option::is_none")]
    pub unit: Option<String>,

    // === Library-type fields ===
    /// Predefined metric name (e.g., "nullValues", "missingValues", "rowCount")
    #[serde(skip_serializing_if = "Option::is_none")]
    pub metric: Option<String>,
    /// Deprecated: use metric instead
    #[serde(skip_serializing_if = "Option::is_none")]
    pub rule: Option<String>,
    /// Additional arguments for the metric
    #[serde(skip_serializing_if = "Option::is_none")]
    pub arguments: Option<serde_json::Value>,

    // === Comparison operators (DataQualityOperators) ===
    /// Condition that must be true (equals)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub must_be: Option<serde_json::Value>,
    /// Condition that must be false (not equals)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub must_not_be: Option<serde_json::Value>,
    /// Greater than condition
    #[serde(skip_serializing_if = "Option::is_none")]
    pub must_be_greater_than: Option<serde_json::Value>,
    /// Greater than or equal condition (ODCS: mustBeGreaterOrEqualTo)
    #[serde(
        rename = "mustBeGreaterOrEqualTo",
        alias = "mustBeGreaterThanOrEqual",
        alias = "mustBeGreaterThanOrEqualTo",
        skip_serializing_if = "Option::is_none"
    )]
    pub must_be_greater_or_equal_to: Option<serde_json::Value>,
    /// Less than condition
    #[serde(skip_serializing_if = "Option::is_none")]
    pub must_be_less_than: Option<serde_json::Value>,
    /// Less than or equal condition (ODCS: mustBeLessOrEqualTo)
    #[serde(
        rename = "mustBeLessOrEqualTo",
        alias = "mustBeLessThanOrEqual",
        alias = "mustBeLessThanOrEqualTo",
        skip_serializing_if = "Option::is_none"
    )]
    pub must_be_less_or_equal_to: Option<serde_json::Value>,
    /// Range: value must be between two numbers [min, max]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub must_be_between: Option<Vec<serde_json::Value>>,
    /// Range: value must not be between two numbers [min, max]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub must_not_be_between: Option<Vec<serde_json::Value>>,
    /// Value must be in this set
    #[serde(skip_serializing_if = "Option::is_none")]
    pub must_be_in: Option<Vec<serde_json::Value>>,
    /// Value must not be in this set
    #[serde(skip_serializing_if = "Option::is_none")]
    pub must_not_be_in: Option<Vec<serde_json::Value>>,

    // === SQL-type fields ===
    /// SQL query for validation
    #[serde(skip_serializing_if = "Option::is_none")]
    pub query: Option<String>,

    // === Custom-type fields ===
    /// Engine for running the quality check (e.g., "soda", "great-expectations")
    #[serde(skip_serializing_if = "Option::is_none")]
    pub engine: Option<String>,
    /// Engine-specific implementation details (string or object)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub implementation: Option<serde_json::Value>,
    /// URL to quality tool or dashboard
    #[serde(skip_serializing_if = "Option::is_none")]
    pub url: Option<String>,

    // === Scheduling ===
    /// Scheduler type for quality checks (e.g., "cron")
    #[serde(skip_serializing_if = "Option::is_none")]
    pub scheduler: Option<String>,
    /// Schedule expression (e.g., "0 20 * * *")
    #[serde(skip_serializing_if = "Option::is_none")]
    pub schedule: Option<String>,

    // === References & Metadata ===
    /// Links to authoritative definitions
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub authoritative_definitions: Vec<AuthoritativeDefinition>,
    /// Tags for categorization
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub tags: Vec<String>,
    /// Additional properties for rule execution
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub custom_properties: Vec<CustomProperty>,

    /// Additional properties not explicitly modeled (stable sorted order)
    #[serde(flatten)]
    pub extra: IndexMap<String, serde_json::Value>,
}

/// Custom property for format-specific metadata (ODCS v3.1.0)
///
/// Used to store metadata that doesn't fit into the standard ODCS fields,
/// such as Avro-specific or Protobuf-specific attributes.
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct CustomProperty {
    /// Property name
    pub property: String,
    /// Property value (flexible type)
    pub value: serde_json::Value,
}

impl CustomProperty {
    /// Create a new custom property
    pub fn new(property: impl Into<String>, value: serde_json::Value) -> Self {
        Self {
            property: property.into(),
            value,
        }
    }

    /// Create a string custom property
    pub fn string(property: impl Into<String>, value: impl Into<String>) -> Self {
        Self {
            property: property.into(),
            value: serde_json::Value::String(value.into()),
        }
    }
}

/// Authoritative definition reference (ODCS v3.1.0)
///
/// Links to external authoritative sources for definitions.
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct AuthoritativeDefinition {
    /// Type of the reference (e.g., "businessDefinition", "transformationImplementation")
    #[serde(rename = "type")]
    pub definition_type: String,
    /// URL to the authoritative definition
    pub url: String,
}

impl AuthoritativeDefinition {
    /// Create a new authoritative definition
    pub fn new(definition_type: impl Into<String>, url: impl Into<String>) -> Self {
        Self {
            definition_type: definition_type.into(),
            url: url.into(),
        }
    }
}

/// Schema-level relationship (ODCS v3.1.0)
///
/// Represents relationships between schema objects (tables).
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct SchemaRelationship {
    /// Relationship type (e.g., "foreignKey", "parent", "child")
    #[serde(rename = "type")]
    pub relationship_type: String,
    /// Source properties (column names) in this schema
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub from_properties: Vec<String>,
    /// Target schema object name
    pub to_schema: String,
    /// Target properties (column names) in the target schema
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub to_properties: Vec<String>,
    /// Optional description
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
}

/// Property-level relationship (ODCS v3.1.0)
///
/// Represents relationships from a property to other definitions.
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct PropertyRelationship {
    /// Relationship type (e.g., "foreignKey", "parent", "child")
    #[serde(rename = "type")]
    pub relationship_type: String,
    /// Target reference (e.g., "definitions/order_id", "schema/id/properties/id")
    pub to: String,
}

impl PropertyRelationship {
    /// Create a new property relationship
    pub fn new(relationship_type: impl Into<String>, to: impl Into<String>) -> Self {
        Self {
            relationship_type: relationship_type.into(),
            to: to.into(),
        }
    }
}

/// Logical type options for additional type metadata (ODCS v3.1.0)
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
#[serde(rename_all = "camelCase")]
pub struct LogicalTypeOptions {
    /// Minimum length for strings
    #[serde(skip_serializing_if = "Option::is_none")]
    pub min_length: Option<i64>,
    /// Maximum length for strings
    #[serde(skip_serializing_if = "Option::is_none")]
    pub max_length: Option<i64>,
    /// Regex pattern for strings
    #[serde(skip_serializing_if = "Option::is_none")]
    pub pattern: Option<String>,
    /// Format hint (e.g., "email", "uuid", "uri")
    #[serde(skip_serializing_if = "Option::is_none")]
    pub format: Option<String>,
    /// Minimum value for numbers/dates
    #[serde(skip_serializing_if = "Option::is_none")]
    pub minimum: Option<serde_json::Value>,
    /// Maximum value for numbers/dates
    #[serde(skip_serializing_if = "Option::is_none")]
    pub maximum: Option<serde_json::Value>,
    /// Exclusive minimum for numbers
    #[serde(skip_serializing_if = "Option::is_none")]
    pub exclusive_minimum: Option<serde_json::Value>,
    /// Exclusive maximum for numbers
    #[serde(skip_serializing_if = "Option::is_none")]
    pub exclusive_maximum: Option<serde_json::Value>,
    /// Precision for decimals
    #[serde(skip_serializing_if = "Option::is_none")]
    pub precision: Option<i32>,
    /// Scale for decimals
    #[serde(skip_serializing_if = "Option::is_none")]
    pub scale: Option<i32>,
}

impl LogicalTypeOptions {
    /// Check if all options are empty/None
    pub fn is_empty(&self) -> bool {
        self.min_length.is_none()
            && self.max_length.is_none()
            && self.pattern.is_none()
            && self.format.is_none()
            && self.minimum.is_none()
            && self.maximum.is_none()
            && self.exclusive_minimum.is_none()
            && self.exclusive_maximum.is_none()
            && self.precision.is_none()
            && self.scale.is_none()
    }
}

/// Team information (ODCS v3.1.0)
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct Team {
    /// Team name
    #[serde(skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Team members
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub members: Vec<TeamMember>,
    /// Additional properties
    #[serde(flatten)]
    pub extra: HashMap<String, serde_json::Value>,
}

/// Team member information
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct TeamMember {
    /// Member name
    #[serde(skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Member email
    #[serde(skip_serializing_if = "Option::is_none")]
    pub email: Option<String>,
    /// Member role
    #[serde(skip_serializing_if = "Option::is_none")]
    pub role: Option<String>,
    /// Additional properties
    #[serde(flatten)]
    pub extra: HashMap<String, serde_json::Value>,
}

/// Support information (ODCS v3.1.0)
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct Support {
    /// Support channel
    #[serde(skip_serializing_if = "Option::is_none")]
    pub channel: Option<String>,
    /// Support URL
    #[serde(skip_serializing_if = "Option::is_none")]
    pub url: Option<String>,
    /// Support email
    #[serde(skip_serializing_if = "Option::is_none")]
    pub email: Option<String>,
    /// Additional properties
    #[serde(flatten)]
    pub extra: HashMap<String, serde_json::Value>,
}

/// Server configuration (ODCS v3.1.0)
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct Server {
    /// Server name/identifier
    #[serde(skip_serializing_if = "Option::is_none")]
    pub server: Option<String>,
    /// Server type (e.g., "BigQuery", "Snowflake", "S3")
    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
    pub server_type: Option<String>,
    /// Server environment (e.g., "production", "development")
    #[serde(skip_serializing_if = "Option::is_none")]
    pub environment: Option<String>,
    /// Server description
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Database name
    #[serde(skip_serializing_if = "Option::is_none")]
    pub database: Option<String>,
    /// Project name (for cloud platforms)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub project: Option<String>,
    /// Schema name
    #[serde(skip_serializing_if = "Option::is_none")]
    pub schema: Option<String>,
    /// Catalog name
    #[serde(skip_serializing_if = "Option::is_none")]
    pub catalog: Option<String>,
    /// Dataset name (for BigQuery)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub dataset: Option<String>,
    /// Account name (for Snowflake)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub account: Option<String>,
    /// Host URL
    #[serde(skip_serializing_if = "Option::is_none")]
    pub host: Option<String>,
    /// Location/Region
    #[serde(skip_serializing_if = "Option::is_none")]
    pub location: Option<String>,
    /// Format for file-based servers
    #[serde(skip_serializing_if = "Option::is_none")]
    pub format: Option<String>,
    /// Delimiter for CSV files
    #[serde(skip_serializing_if = "Option::is_none")]
    pub delimiter: Option<String>,
    /// Topic name for streaming
    #[serde(skip_serializing_if = "Option::is_none")]
    pub topic: Option<String>,
    /// Additional properties
    #[serde(flatten)]
    pub extra: HashMap<String, serde_json::Value>,
}

/// Role definition (ODCS v3.1.0)
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct Role {
    /// Role name
    #[serde(skip_serializing_if = "Option::is_none")]
    pub role: Option<String>,
    /// Role description
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Principal (user/group)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub principal: Option<String>,
    /// Access level
    #[serde(skip_serializing_if = "Option::is_none")]
    pub access: Option<String>,
    /// Additional properties
    #[serde(flatten)]
    pub extra: HashMap<String, serde_json::Value>,
}

/// Service level definition (ODCS v3.1.0)
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct ServiceLevel {
    /// Service level property name
    #[serde(skip_serializing_if = "Option::is_none")]
    pub property: Option<String>,
    /// Value
    #[serde(skip_serializing_if = "Option::is_none")]
    pub value: Option<serde_json::Value>,
    /// Unit of measurement
    #[serde(skip_serializing_if = "Option::is_none")]
    pub unit: Option<String>,
    /// Element this applies to
    #[serde(skip_serializing_if = "Option::is_none")]
    pub element: Option<String>,
    /// Driver for this SLA
    #[serde(skip_serializing_if = "Option::is_none")]
    pub driver: Option<String>,
    /// Description
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Scheduler
    #[serde(skip_serializing_if = "Option::is_none")]
    pub scheduler: Option<String>,
    /// Schedule expression
    #[serde(skip_serializing_if = "Option::is_none")]
    pub schedule: Option<String>,
    /// Additional properties
    #[serde(flatten)]
    pub extra: HashMap<String, serde_json::Value>,
}

/// Price information (ODCS v3.1.0)
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct Price {
    /// Price amount
    #[serde(skip_serializing_if = "Option::is_none")]
    pub amount: Option<serde_json::Value>,
    /// Currency
    #[serde(skip_serializing_if = "Option::is_none")]
    pub currency: Option<String>,
    /// Billing frequency
    #[serde(skip_serializing_if = "Option::is_none")]
    pub billing_frequency: Option<String>,
    /// Price model type
    #[serde(skip_serializing_if = "Option::is_none")]
    pub price_model: Option<String>,
    /// Additional properties
    #[serde(flatten)]
    pub extra: HashMap<String, serde_json::Value>,
}

/// Terms and conditions (ODCS v3.1.0)
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct Terms {
    /// Terms description
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Usage limitations
    #[serde(skip_serializing_if = "Option::is_none")]
    pub limitations: Option<String>,
    /// URL to full terms
    #[serde(skip_serializing_if = "Option::is_none")]
    pub url: Option<String>,
    /// Additional properties
    #[serde(flatten)]
    pub extra: HashMap<String, serde_json::Value>,
}

/// Link to external resource (ODCS v3.1.0)
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct Link {
    /// Link type
    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
    pub link_type: Option<String>,
    /// URL
    #[serde(skip_serializing_if = "Option::is_none")]
    pub url: Option<String>,
    /// Description
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Additional properties
    #[serde(flatten)]
    pub extra: HashMap<String, serde_json::Value>,
}

/// Description that can be string or structured object (ODCS v3.1.0)
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
#[serde(untagged)]
pub enum Description {
    /// Simple string description
    Simple(String),
    /// Structured description object
    Structured(StructuredDescription),
}

impl Default for Description {
    fn default() -> Self {
        Description::Simple(String::new())
    }
}

impl Description {
    /// Get the description as a simple string
    pub fn as_string(&self) -> String {
        match self {
            Description::Simple(s) => s.clone(),
            Description::Structured(d) => d.purpose.clone().unwrap_or_default(),
        }
    }
}

/// Structured description with multiple fields
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct StructuredDescription {
    /// Purpose of the data
    #[serde(skip_serializing_if = "Option::is_none")]
    pub purpose: Option<String>,
    /// Limitations of the data
    #[serde(skip_serializing_if = "Option::is_none")]
    pub limitations: Option<String>,
    /// Usage guidelines
    #[serde(skip_serializing_if = "Option::is_none")]
    pub usage: Option<String>,
    /// Additional properties
    #[serde(flatten)]
    pub extra: HashMap<String, serde_json::Value>,
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_quality_rule_serialization() {
        let rule = QualityRule {
            dimension: Some("accuracy".to_string()),
            must_be: Some(serde_json::json!(true)),
            ..Default::default()
        };
        let json = serde_json::to_string(&rule).unwrap();
        assert!(json.contains("dimension"));
        assert!(json.contains("accuracy"));
    }

    #[test]
    fn test_custom_property() {
        let prop = CustomProperty::string("source_format", "avro");
        assert_eq!(prop.property, "source_format");
        assert_eq!(prop.value, serde_json::json!("avro"));
    }

    #[test]
    fn test_description_variants() {
        let simple: Description = serde_json::from_str(r#""A simple description""#).unwrap();
        assert_eq!(simple.as_string(), "A simple description");

        let structured: Description =
            serde_json::from_str(r#"{"purpose": "Data analysis", "usage": "Read-only"}"#).unwrap();
        assert_eq!(structured.as_string(), "Data analysis");
    }

    #[test]
    fn test_logical_type_options_is_empty() {
        let empty = LogicalTypeOptions::default();
        assert!(empty.is_empty());

        let with_length = LogicalTypeOptions {
            max_length: Some(100),
            ..Default::default()
        };
        assert!(!with_length.is_empty());
    }
}