#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Term {
pub source_text: ::std::option::Option<::std::string::String>,
pub target_text: ::std::option::Option<::std::string::String>,
}
impl Term {
pub fn source_text(&self) -> ::std::option::Option<&str> {
self.source_text.as_deref()
}
pub fn target_text(&self) -> ::std::option::Option<&str> {
self.target_text.as_deref()
}
}
impl Term {
pub fn builder() -> crate::types::builders::TermBuilder {
crate::types::builders::TermBuilder::default()
}
}
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct TermBuilder {
pub(crate) source_text: ::std::option::Option<::std::string::String>,
pub(crate) target_text: ::std::option::Option<::std::string::String>,
}
impl TermBuilder {
pub fn source_text(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.source_text = ::std::option::Option::Some(input.into());
self
}
pub fn set_source_text(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.source_text = input;
self
}
pub fn get_source_text(&self) -> &::std::option::Option<::std::string::String> {
&self.source_text
}
pub fn target_text(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.target_text = ::std::option::Option::Some(input.into());
self
}
pub fn set_target_text(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.target_text = input;
self
}
pub fn get_target_text(&self) -> &::std::option::Option<::std::string::String> {
&self.target_text
}
pub fn build(self) -> crate::types::Term {
crate::types::Term {
source_text: self.source_text,
target_text: self.target_text,
}
}
}