MCPcopy Index your code
hub / github.com/cedar-policy/cedar-java / try_from

Method try_from

CedarJavaFFI/src/objects.rs:105–114  ·  view source on GitHub ↗

Given a rust EntityTypeName, allocate a new Java EntityTypeName object

(env: &mut JNIEnv<'a>, etype: &EntityTypeName)

Source from the content-addressed store, hash-verified

103
104 /// Given a rust EntityTypeName, allocate a new Java EntityTypeName object
105 pub fn try_from(env: &mut JNIEnv<'a>, etype: &EntityTypeName) -> Result<Self> {
106 let basename = env.new_string(etype.basename())?;
107 let mut namespace_array = List::new(env)?;
108 for part in etype.namespace_components() {
109 let part_str = env.new_string(part)?;
110 namespace_array.add(env, part_str)?;
111 }
112
113 JEntityTypeName::new(env, basename, namespace_array)
114 }
115
116 /// Attempt to parse an EntityTypeName from a string, and allocate the result as a Java object
117 pub fn parse(env: &mut JNIEnv<'a>, src: &str) -> Result<JOptional<'a, Self>> {

Callers

nothing calls this directly

Calls 1

addMethod · 0.45

Tested by

no test coverage detected