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

Function create_java_map_from_annotations

CedarJavaFFI/src/interface.rs:783–796  ·  view source on GitHub ↗
(
    env: &mut JNIEnv<'a>,
    annotations: impl Iterator<Item = (&'b str, &'b str)>,
)

Source from the content-addressed store, hash-verified

781}
782
783fn create_java_map_from_annotations<'a, 'b>(
784 env: &mut JNIEnv<'a>,
785 annotations: impl Iterator<Item = (&'b str, &'b str)>,
786) -> JObject<'a> {
787 let mut map = Map::new(env).unwrap();
788
789 for (annotation_key, annotation_value) in annotations {
790 let key: JString = env.new_string(annotation_key).unwrap().into();
791 let value: JString = env.new_string(annotation_value).unwrap().into();
792 map.put(env, key, value).unwrap();
793 }
794
795 map.into_inner()
796}
797
798#[jni_fn("com.cedarpolicy.model.policy.Policy")]
799pub fn parsePolicyTemplateJni<'a>(

Calls 2

into_innerMethod · 0.80
putMethod · 0.45

Tested by

no test coverage detected