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

Method get

CedarJavaFFI/src/jmap.rs:50–61  ·  view source on GitHub ↗

Get a value mapped to a key

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

Source from the content-addressed store, hash-verified

48
49 /// Get a value mapped to a key
50 pub fn get(&mut self, env: &mut JNIEnv<'a>, k: T) -> Result<JObject<'a>> {
51 let key = JValueGen::Object(k.as_ref());
52 let value = env
53 .call_method(
54 &self.obj,
55 "get",
56 "(Ljava/lang/Object;)Ljava/lang/Object;",
57 &[key],
58 )?
59 .l()?;
60 Ok(value)
61 }
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>> {

Callers 2

map_get_testsFunction · 0.45

Calls 2

ObjectInterface · 0.85
as_refMethod · 0.45

Tested by 1

map_get_testsFunction · 0.36