use crate::{Result, Rudof, api::shex::ShExOperations};
pub struct AddNodeShapeToShapemapBuilder<'a> {
rudof: &'a mut Rudof,
node: &'a str,
shape: Option<&'a str>,
base_nodes: Option<&'a str>,
base_shapes: Option<&'a str>,
}
impl<'a> AddNodeShapeToShapemapBuilder<'a> {
pub(crate) fn new(rudof: &'a mut Rudof, node: &'a str) -> Self {
Self {
rudof,
node,
shape: None,
base_nodes: None,
base_shapes: None,
}
}
pub fn with_shape(mut self, shape: &'a str) -> Self {
self.shape = Some(shape);
self
}
pub fn with_base_nodes(mut self, base: &'a str) -> Self {
self.base_nodes = Some(base);
self
}
pub fn with_base_shapes(mut self, base: &'a str) -> Self {
self.base_shapes = Some(base);
self
}
pub fn execute(self) -> Result<()> {
<Rudof as ShExOperations>::add_node_shape_to_shapemap(
self.rudof,
self.node,
self.shape,
self.base_nodes,
self.base_shapes,
)
}
}