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

Function get_object_ref

CedarJavaFFI/src/utils.rs:75–83  ·  view source on GitHub ↗

Given a Java value, extracts the object reference if it exists, otherwise errors

(v: JValueGen<JObject<'_>>)

Source from the content-addressed store, hash-verified

73
74/// Given a Java value, extracts the object reference if it exists, otherwise errors
75pub fn get_object_ref(v: JValueGen<JObject<'_>>) -> Result<JObject<'_>> {
76 match v {
77 JValueGen::Object(o) => Ok(o),
78 _ => Err(Box::new(InternalJNIError::BadMemberType {
79 expected: "object",
80 got: value_type(v),
81 })),
82 }
83}
84
85pub fn value_type<T>(v: JValueGen<T>) -> &'static str {
86 match v {

Callers 5

get_class_nameFunction · 0.85
getMethod · 0.85
get_namespaceMethod · 0.85
get_basenameMethod · 0.85
castMethod · 0.85

Calls 1

value_typeFunction · 0.85

Tested by

no test coverage detected