Skip to content

Commit eb04e09

Browse files
HNSW index: rename ObjectWithScore.getObject() to get() to avoid escaping
Also use Java style for method docs.
1 parent c4e33a8 commit eb04e09

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

objectbox-java/src/main/java/io/objectbox/query/IdWithScore.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ public IdWithScore(long id, double score) {
3131
}
3232

3333
/**
34-
* The object ID.
34+
* Returns the object ID.
3535
*/
3636
public long getId() {
3737
return id;
3838
}
3939

4040
/**
41-
* The query score for the {@link #getId() id}.
41+
* Returns the query score for the {@link #getId() id}.
4242
* <p>
4343
* The query score indicates some quality measurement. E.g. for vector nearest neighbor searches, the score is the
4444
* distance to the given vector.

objectbox-java/src/main/java/io/objectbox/query/ObjectWithScore.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,16 @@ public ObjectWithScore(T object, double score) {
3030
this.score = score;
3131
}
3232

33+
// Do not use getObject() to avoid having to escape the name in Kotlin
3334
/**
34-
* The object.
35+
* Returns the matching object.
3536
*/
36-
public T getObject() {
37+
public T get() {
3738
return object;
3839
}
3940

4041
/**
41-
* The query score for the {@link #getObject() object}.
42+
* Returns the query score for the {@link #get() object}.
4243
* <p>
4344
* The query score indicates some quality measurement. E.g. for vector nearest neighbor searches, the score is the
4445
* distance to the given vector.

objectbox-java/src/main/java/io/objectbox/query/Query.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ public List<ObjectWithScore<T>> findWithScores(final long offset, final long lim
430430
List<ObjectWithScore<T>> results = nativeFindWithScores(handle, cursorHandle(), offset, limit);
431431
if (eagerRelations != null) {
432432
for (int i = 0; i < results.size(); i++) {
433-
resolveEagerRelationForNonNullEagerRelations(results.get(i).getObject(), i);
433+
resolveEagerRelationForNonNullEagerRelations(results.get(i).get(), i);
434434
}
435435
}
436436
return results;

0 commit comments

Comments
 (0)