use crate::types::Span;
use super::object::EntityData;
use super::types::*;
#[derive(Debug, Clone)]
pub struct GroupData {
pub(crate) entity: EntityData,
pub(crate) members: Vec<NodeId>,
pub(crate) is_notification_group: bool,
}
impl GroupData {
pub(crate) fn new(name: String) -> Self {
Self {
entity: EntityData::new(name),
members: Vec::new(),
is_notification_group: false,
}
}
pub fn name(&self) -> &str {
&self.entity.name
}
pub fn span(&self) -> Span {
self.entity.span
}
pub fn node(&self) -> Option<NodeId> {
self.entity.node
}
pub fn module(&self) -> Option<ModuleId> {
self.entity.module
}
pub fn status(&self) -> crate::types::Status {
self.entity.status
}
pub fn description(&self) -> &str {
&self.entity.description
}
pub fn reference(&self) -> &str {
&self.entity.reference
}
pub fn oid_refs(&self) -> &[OidRef] {
&self.entity.oid_refs
}
pub fn members(&self) -> &[NodeId] {
&self.members
}
pub fn is_notification_group(&self) -> bool {
self.is_notification_group
}
}