#[derive(
Debug,
Clone,
conjure_object::serde::Serialize,
conjure_object::serde::Deserialize,
conjure_object::private::DeriveWith
)]
#[serde(crate = "conjure_object::serde")]
#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
#[conjure_object::private::staged_builder::staged_builder]
#[builder(crate = conjure_object::private::staged_builder, update, inline)]
pub struct NumericPropertyRangePredicate {
#[serde(rename = "name")]
name: super::PropertyName,
#[builder(default, into)]
#[serde(rename = "min", skip_serializing_if = "Option::is_none", default)]
#[derive_with(with = conjure_object::private::DoubleWrapper)]
min: Option<f64>,
#[builder(default, into)]
#[serde(rename = "max", skip_serializing_if = "Option::is_none", default)]
#[derive_with(with = conjure_object::private::DoubleWrapper)]
max: Option<f64>,
#[serde(rename = "operator")]
operator: super::NumericPropertyRangeOperator,
}
impl NumericPropertyRangePredicate {
#[inline]
pub fn new(
name: super::PropertyName,
operator: super::NumericPropertyRangeOperator,
) -> Self {
Self::builder().name(name).operator(operator).build()
}
#[inline]
pub fn name(&self) -> &super::PropertyName {
&self.name
}
#[inline]
pub fn min(&self) -> Option<f64> {
self.min.as_ref().map(|o| *o)
}
#[inline]
pub fn max(&self) -> Option<f64> {
self.max.as_ref().map(|o| *o)
}
#[inline]
pub fn operator(&self) -> &super::NumericPropertyRangeOperator {
&self.operator
}
}