Add an item to the back of the list
(&mut self, env: &mut JNIEnv<'a>, v: T)
| 50 | |
| 51 | /// Add an item to the back of the list |
| 52 | pub fn add(&mut self, env: &mut JNIEnv<'a>, v: T) -> Result<()> { |
| 53 | let value = JValueGen::Object(v.as_ref()); |
| 54 | env.call_method(&self.obj, "add", "(Ljava/lang/Object;)Z", &[value])?; |
| 55 | self.size += 1; |
| 56 | Ok(()) |
| 57 | } |
| 58 | |
| 59 | /// Cast from an untyped java object to this wrapper |
| 60 | /// We can't check this as I don't see a way to list a class's interfaces |