private Object checkAndProxyReturnValue ( Object retValue ) { if ( retValue != null && retValue instanceof RESTBaseEntityCollectionV1 ) { // The parent will either be a user defined parent, or the entity itself. final RESTBaseEntityV1 < ? > parent = this . parent == null ? getProxyEntity ( ) : this . parent ; return RESTCollectionProxyFactory . create ( getProviderFactory ( ) , ( RESTBaseEntityCollectionV1 ) retValue , isRevision , parent ) ; } else { return retValue ; } }
Checks the return value and creates a proxy for the content if required .