Skip to content

Commit 4469bd5

Browse files
Add more docs to new store create, read-only, validate methods.
1 parent 3ae3d7d commit 4469bd5

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

objectbox-java/src/main/java/io/objectbox/BoxStore.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,22 @@ public static String getVersionNative() {
136136
*/
137137
public static native void testUnalignedMemoryAccess();
138138

139+
/**
140+
* @deprecated Use {@link #nativeCreateWithFlatOptions(byte[], byte[])} instead.
141+
*/
139142
@Deprecated
140143
static native long nativeCreate(String directory, long maxDbSizeInKByte, int maxReaders, byte[] model);
141144

145+
/**
146+
* Creates a native BoxStore instance with FlatBuffer {@link io.objectbox.model.FlatStoreOptions} {@code options}
147+
* and a {@link ModelBuilder} {@code model}. Returns the handle of the native store instance.
148+
*/
142149
static native long nativeCreateWithFlatOptions(byte[] options, byte[] model);
143150

151+
/**
152+
* Returns whether the store was created using read-only mode.
153+
* If true the schema is not updated and write transactions are not possible.
154+
*/
144155
static native boolean nativeIsReadOnly(long store);
145156

146157
static native void nativeDelete(long store);
@@ -171,6 +182,11 @@ static native void nativeRegisterCustomType(long store, int entityId, int proper
171182

172183
static native boolean nativeIsObjectBrowserAvailable();
173184

185+
/**
186+
* Validates up to {@code pageLimit} pages of the store. Set {@code checkLeafLevel} to check leafs, too.
187+
* Throws StorageException if validation fails.
188+
* Throws DbFileCorruptException or DbPagesCorruptException if the DB is actually inconsistent (corrupt).
189+
*/
174190
native long nativeValidate(long store, long pageLimit, boolean checkLeafLevel);
175191

176192
public static boolean isObjectBrowserAvailable() {

0 commit comments

Comments
 (0)