Edit: There actually is a convenience API:
final StructuredQuery query;
final MmpurReqFluentHelper helper;
ValueBoolean filter = query.getFilters().stream().reduce(ValueBoolean::and).orElse(null);
helper.filter(new UncheckedFilterExpression<>(filter));
It's not expected to use classes from Generic OData Client API (StructuredQuery
) on the OData V2/V4 VDM API (MmpurReqFluentHelper
). However you can apply the following workaround:
final StructuredQuery query;
final MmpurReqFluentHelper helper;
helper.filter(new FilterExpressionHelper<EntityT>() {
@Override
@Nullable
FilterExpression toLegacyFilterExpression() {
throw new IllegalStateException();
}
@Override
@Nullable
ValueBoolean toClientFilterExpression() {
return query.getFilters().stream().reduce(ValueBoolean::and).orElse(null);
}
});
Please replace EntityT
with the respective entity type reference.