Skip to content

Commit

Permalink
HSEARCH-4203 Fix javadoc of PojoLoader.castToExactTypeOrNull
Browse files Browse the repository at this point in the history
  • Loading branch information
yrodiere committed May 7, 2021
1 parent 3c38c89 commit 610506c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Expand Up @@ -64,7 +64,7 @@ public <E2> PojoLoader<E2> createLoader(Set<LoadingIndexedTypeContext<? extends
targetEntityTypeContexts.iterator().next();
/*
* This cast is safe: the loader will only return instances of E2.
* See hasExpectedType() and its callers for more information,
* See PojoLoader.castToExactTypeOrNull() and its callers for more information,
* in particular runtime checks handling edge cases.
*/
@SuppressWarnings("unchecked")
Expand All @@ -88,7 +88,7 @@ public <E2> PojoLoader<E2> createLoader(Set<LoadingIndexedTypeContext<? extends
*
* However, we perform some runtime checks that make this cast safe.
*
* See hasExpectedType() and its callers for more information.
* See PojoLoader.castToExactTypeOrNull() and its callers for more information.
*/
@SuppressWarnings("unchecked")
PojoLoader<E2> result = (PojoLoader<E2>) doCreate( commonSuperType, sessionContext, cacheLookupStrategy,
Expand Down
Expand Up @@ -71,7 +71,8 @@ public interface PojoLoader<E> {
* when creating this loader.
* @param loadedObject A loaded object, i.e. an element retrieved from the list
* returned by {@link #loadBlocking(List, Deadline)}.
* @return {@code true} if the loaded object is an instance of the expected type or a subtype.
* @return The given {@code loadedObject} if is an instance of {@code expectedType} exactly (not an instance of a subtype).
* {@code null} otherwise.
*/
<E2 extends E> E2 castToExactTypeOrNull(PojoRawTypeIdentifier<E2> expectedType, Object loadedObject);

Expand Down

0 comments on commit 610506c

Please sign in to comment.