77 private final long nativeRef;
78 private final AtomicBoolean destroyed =
new AtomicBoolean(
false);
80 private CppProxy(
long nativeRef)
82 if (nativeRef == 0)
throw new RuntimeException(
"nativeRef is zero");
83 this.nativeRef = nativeRef;
86 private native
void nativeDestroy(
long nativeRef);
87 public void _djinni_private_destroy()
89 boolean destroyed = this.destroyed.getAndSet(
true);
90 if (!destroyed) nativeDestroy(this.nativeRef);
92 protected void finalize() throws
java.lang.Throwable
94 _djinni_private_destroy();
103 assert !this.destroyed.get() :
"trying to use a destroyed object";
104 return native_getId(this.nativeRef);
106 private native
int native_getId(
long _nativeRef);
109 public String getTitle()
111 assert !this.destroyed.get() :
"trying to use a destroyed object";
112 return native_getTitle(this.nativeRef);
114 private native String native_getTitle(
long _nativeRef);
117 public String getContent()
119 assert !this.destroyed.get() :
"trying to use a destroyed object";
120 return native_getContent(this.nativeRef);
122 private native String native_getContent(
long _nativeRef);
125 public String getImageUrl()
127 assert !this.destroyed.get() :
"trying to use a destroyed object";
128 return native_getImageUrl(this.nativeRef);
130 private native String native_getImageUrl(
long _nativeRef);