81 private final long nativeRef;
82 private final AtomicBoolean destroyed =
new AtomicBoolean(
false);
84 private CppProxy(
long nativeRef)
86 if (nativeRef == 0)
throw new RuntimeException(
"nativeRef is zero");
87 this.nativeRef = nativeRef;
90 private native
void nativeDestroy(
long nativeRef);
91 public void _djinni_private_destroy()
93 boolean destroyed = this.destroyed.getAndSet(
true);
94 if (!destroyed) nativeDestroy(this.nativeRef);
96 protected void finalize() throws
java.lang.Throwable
98 _djinni_private_destroy();
107 assert !this.destroyed.get() :
"trying to use a destroyed object";
108 return native_getId(this.nativeRef);
110 private native
int native_getId(
long _nativeRef);
113 public String getTitle()
115 assert !this.destroyed.get() :
"trying to use a destroyed object";
116 return native_getTitle(this.nativeRef);
118 private native String native_getTitle(
long _nativeRef);
121 public String getContent()
123 assert !this.destroyed.get() :
"trying to use a destroyed object";
124 return native_getContent(this.nativeRef);
126 private native String native_getContent(
long _nativeRef);
129 public String getImageUrl()
131 assert !this.destroyed.get() :
"trying to use a destroyed object";
132 return native_getImageUrl(this.nativeRef);
134 private native String native_getImageUrl(
long _nativeRef);