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

Method put

CedarJavaFFI/src/jmap.rs:64–76  ·  view source on GitHub ↗

Put a key-value pair into the map

(&mut self, env: &mut JNIEnv<'a>, k: T, v: U)

Source from the content-addressed store, hash-verified

62
63 /// Put a key-value pair into the map
64 pub fn put(&mut self, env: &mut JNIEnv<'a>, k: T, v: U) -> Result<JObject<'a>> {
65 let key = JValueGen::Object(k.as_ref());
66 let value = JValueGen::Object(v.as_ref());
67 let value = env
68 .call_method(
69 &self.obj,
70 "put",
71 "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;",
72 &[key, value],
73 )?
74 .l()?;
75 Ok(value)
76 }
77
78 /// Consumes the Map and returns the underlying JObject
79 pub fn into_inner(self) -> JObject<'a> {

Callers 3

map_put_testsFunction · 0.45
map_get_testsFunction · 0.45

Calls 2

ObjectInterface · 0.85
as_refMethod · 0.45

Tested by 2

map_put_testsFunction · 0.36
map_get_testsFunction · 0.36