#[derive(Debug, Clone, Default)]
pub struct PackageQuery {
pub version: Option<String>,
pub distribution: Option<String>,
pub architecture: Option<String>,
pub package_type: Option<String>,
pub operating_system: Option<String>,
pub archive_types: Option<Vec<String>>,
pub latest: Option<String>,
pub directly_downloadable: Option<bool>,
pub lib_c_type: Option<String>,
pub javafx_bundled: Option<bool>,
}
impl PackageQuery {
pub fn new() -> Self {
Self::default()
}
pub fn version(mut self, version: impl Into<String>) -> Self {
self.version = Some(version.into());
self
}
pub fn distribution(mut self, distribution: impl Into<String>) -> Self {
self.distribution = Some(distribution.into());
self
}
pub fn architecture(mut self, architecture: impl Into<String>) -> Self {
self.architecture = Some(architecture.into());
self
}
pub fn package_type(mut self, package_type: impl Into<String>) -> Self {
self.package_type = Some(package_type.into());
self
}
pub fn operating_system(mut self, operating_system: impl Into<String>) -> Self {
self.operating_system = Some(operating_system.into());
self
}
pub fn archive_types(mut self, archive_types: Vec<String>) -> Self {
self.archive_types = Some(archive_types);
self
}
pub fn latest(mut self, latest: impl Into<String>) -> Self {
self.latest = Some(latest.into());
self
}
pub fn directly_downloadable(mut self, directly_downloadable: bool) -> Self {
self.directly_downloadable = Some(directly_downloadable);
self
}
pub fn lib_c_type(mut self, lib_c_type: impl Into<String>) -> Self {
self.lib_c_type = Some(lib_c_type.into());
self
}
pub fn javafx_bundled(mut self, javafx_bundled: bool) -> Self {
self.javafx_bundled = Some(javafx_bundled);
self
}
}