/** * Returns a copy of the {@link ObjectPath} with the given {@link Object} as current object. * * @param object must not be {@literal null}. * @param entity must not be {@literal null}. * @param id must not be {@literal null}. * @return new instance of {@link ObjectPath}. */ ObjectPath push(Object object, MongoPersistentEntity<?> entity, @Nullable Object id) { Assert.notNull(object, "Object must not be null!"); Assert.notNull(entity, "MongoPersistentEntity must not be null!"); return new ObjectPath(this, object, id, entity.getCollection()); }
/** * Returns a copy of the {@link ObjectPath} with the given {@link Object} as current object. * * @param object must not be {@literal null}. * @param entity must not be {@literal null}. * @param id must not be {@literal null}. * @return new instance of {@link ObjectPath}. */ ObjectPath push(Object object, MongoPersistentEntity<?> entity, @Nullable Object id) { Assert.notNull(object, "Object must not be null!"); Assert.notNull(entity, "MongoPersistentEntity must not be null!"); return new ObjectPath(this, object, id, entity.getCollection()); }