use super::structure::FirstName;
pub struct FirstNameBuilder {
value: Option<String>,
}
impl FirstNameBuilder {
pub fn new() -> Self {
FirstNameBuilder { value: None }
}
pub fn value(mut self, value: String) -> Self {
self.value = Some(value);
self
}
pub fn build(self) -> Result<FirstName, &'static str> {
Ok(FirstName { value: self.value })
}
}
impl Default for FirstNameBuilder {
fn default() -> Self {
Self::new()
}
}