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

Method into_primitive

rust/src/api/invocation_arg.rs:195–199  ·  view source on GitHub ↗

Consumes this InvocationArg and transforms it to an InvocationArg that contains a Java primitive, leveraging Java's autoboxing. This action can be done by calling `Jvm::cast` of Instances as well (e.g.: jvm.cast(&instance, "int")) but calling `into_primitive` is faster, as it does not involve JNI calls.

(self)

Source from the content-addressed store, hash-verified

193 /// This action can be done by calling `Jvm::cast` of Instances as well (e.g.: jvm.cast(&instance, "int"))
194 /// but calling `into_primitive` is faster, as it does not involve JNI calls.
195 pub fn into_primitive(self) -> errors::Result<InvocationArg> {
196 let mut ia = self;
197 ia.make_primitive()?;
198 Ok(ia)
199 }
200
201 /// Creates a `jobject` from this InvocationArg.
202 pub fn as_java_ptr_with_global_ref(&self, jni_env: *mut JNIEnv) -> errors::Result<jobject> {

Callers 15

use_to_rust_deserializedFunction · 0.80
use_to_rust_boxedFunction · 0.80
check_equalsFunction · 0.80
test_byte_array_to_rustFunction · 0.80
test_short_array_to_rustFunction · 0.80
test_char_array_to_rustFunction · 0.80
test_int_array_to_rustFunction · 0.80
test_long_array_to_rustFunction · 0.80
test_float_array_to_rustFunction · 0.80

Calls 1

make_primitiveMethod · 0.80

Tested by 15

check_equalsFunction · 0.64
test_byte_array_to_rustFunction · 0.64
test_short_array_to_rustFunction · 0.64
test_char_array_to_rustFunction · 0.64
test_int_array_to_rustFunction · 0.64
test_long_array_to_rustFunction · 0.64
test_float_array_to_rustFunction · 0.64
test_int_to_rustFunction · 0.64