Given a Java value, extracts the object reference if it exists, otherwise errors
(v: JValueGen<JObject<'_>>)
| 73 | |
| 74 | /// Given a Java value, extracts the object reference if it exists, otherwise errors |
| 75 | pub 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 | |
| 85 | pub fn value_type<T>(v: JValueGen<T>) -> &'static str { |
| 86 | match v { |
no test coverage detected