MCPcopy Create free account
hub / github.com/astonbitecode/j4rs / java_list

Method java_list

rust/src/api/mod.rs:629–637  ·  view source on GitHub ↗

Creates a new Java List with elements of the class `inner_class_name`.

(
        &self,
        inner_class_name: impl Into<&'a str>,
        inv_args: Vec<impl TryInto<InvocationArg, Error = J4RsError>>,
    )

Source from the content-addressed store, hash-verified

627
628 /// Creates a new Java List with elements of the class `inner_class_name`.
629 pub fn java_list<'a>(
630 &self,
631 inner_class_name: impl Into<&'a str>,
632 inv_args: Vec<impl TryInto<InvocationArg, Error = J4RsError>>,
633 ) -> errors::Result<Instance> {
634 let v: Result<Vec<InvocationArg>, J4RsError> =
635 inv_args.into_iter().map(|arg| arg.try_into()).collect();
636 Self::do_create_java_list(self.jni_env, inner_class_name.into(), v?.as_ref())
637 }
638
639 fn do_create_java_list(
640 jni_env: *mut JNIEnv,

Callers 1

invoke_vecFunction · 0.80

Calls 2

collectMethod · 0.80
mapMethod · 0.80

Tested by 1

invoke_vecFunction · 0.64