use alloc::string::String;
use core::fmt::Display;
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct EntityRelationshipAttribute {
name: String,
attribute_type: String,
}
impl EntityRelationshipAttribute {
#[must_use]
pub fn new(attribute_type: String, name: String) -> Self {
Self { name, attribute_type }
}
#[must_use]
pub fn name(&self) -> &str {
&self.name
}
#[must_use]
pub fn attribute_type(&self) -> &str {
&self.attribute_type
}
}
impl Display for EntityRelationshipAttribute {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{} {}", self.name, self.attribute_type)
}
}