pub fn import<P, N>(package: P, name: N) -> Import
Expand description
The import of a Java type import java.util.Optional;
.
ยงExamples
use genco::prelude::*;
let integer = java::import("java.lang", "Integer");
let a = java::import("java.io", "A");
let toks = quote! {
$integer
$a
};
assert_eq!(
vec![
"import java.io.A;",
"",
"Integer",
"A",
],
toks.to_file_vec()?
);