use crate::entities::manufacturer::structure::Manufacturer;
use super::structure::Maker;
pub struct MakerBuilder {
manufacturers: Vec<Manufacturer>,
}
impl MakerBuilder {
pub fn new() -> Self {
MakerBuilder {
manufacturers: Vec::new(),
}
}
pub fn add_manufacturer(mut self, manufacturer: Manufacturer) -> Self {
self.manufacturers.push(manufacturer);
self
}
pub fn build(self) -> Result<Maker, &'static str> {
Ok(Maker {
manufacturers: self.manufacturers,
})
}
}
impl Default for MakerBuilder {
fn default() -> Self {
Self::new()
}
}