MCPcopy Create free account
hub / github.com/cedar-policy/cedar-java / get_class_name

Function get_class_name

CedarJavaFFI/src/utils.rs:51–56  ·  view source on GitHub ↗

Get the name of a class as a String

(env: &mut JNIEnv<'a>, class: JClass<'a>)

Source from the content-addressed store, hash-verified

49
50/// Get the name of a class as a String
51pub fn get_class_name<'a>(env: &mut JNIEnv<'a>, class: JClass<'a>) -> Result<String> {
52 let result = env.call_method(class, "toString", "()Ljava/lang/String;", &[])?;
53 let obj = get_object_ref(result)?.into();
54 let jstring = env.get_string(&obj)?;
55 Ok(jstring.into())
56}
57
58/// JNI Errors and internal invariant violations
59#[derive(Debug, Error)]

Callers 1

assert_is_classFunction · 0.85

Calls 1

get_object_refFunction · 0.85

Tested by

no test coverage detected