use crate::model::xal::enums::IdentifierElementType;
#[derive(Debug, Clone, PartialEq)]
pub struct Identifier {
content: String,
identifier_type: Option<IdentifierElementType>,
}
impl Identifier {
pub fn new(content: String) -> Self {
Self {
content,
identifier_type: None,
}
}
pub fn with_identifier_type(content: String, identifier_type: IdentifierElementType) -> Self {
Self {
content,
identifier_type: Some(identifier_type),
}
}
pub fn with_optional_identifier_type(
content: String,
identifier_type: Option<IdentifierElementType>,
) -> Self {
match identifier_type {
Some(identifier_type) => Self::with_identifier_type(content, identifier_type),
None => Self::new(content),
}
}
pub fn content(&self) -> &str {
&self.content
}
pub fn identifier_type(&self) -> Option<IdentifierElementType> {
self.identifier_type
}
}