public interface ProductProjectionByIdGet extends MetaModelGetDsl<ProductProjection,ProductProjection,ProductProjectionByIdGet,ProductProjectionExpansionModel<ProductProjection>>, PriceSelectionRequestDsl<ProductProjectionByIdGet>, LocaleSelectionRequestDsl<ProductProjectionByIdGet>, StoreSelectionRequestDsl<ProductProjectionByIdGet>
deserializecanDeserialize, httpRequestIntentplusExpansionPaths, withExpansionPathsplusExpansionPaths, plusExpansionPaths, plusExpansionPaths, withExpansionPaths, withExpansionPathsgetPriceSelection, withPriceSelectiongetLocaleSelection, withLocaleSelectiongetStoreSelection, withStoreSelectionstatic ProductProjectionByIdGet of(ProductIdentifiable product, ProductProjectionType projectionType)
static ProductProjectionByIdGet ofCurrent(ProductIdentifiable product)
static ProductProjectionByIdGet ofStaged(ProductIdentifiable product)
static ProductProjectionByIdGet of(String id, ProductProjectionType projectionType)
static ProductProjectionByIdGet ofStaged(String id)
static ProductProjectionByIdGet ofCurrent(String id)
List<ExpansionPath<ProductProjection>> expansionPaths()
expansionPaths in interface ExpansionPathContainer<ProductProjection>expansionPaths in interface ReferenceExpansionSupport<ProductProjection>ProductProjectionByIdGet plusExpansionPaths(ExpansionPath<ProductProjection> expansionPath)
ReferenceExpansionDslexpansionPath to the expansion paths.
An example in the product projection context:
final ProductProjectionByIdGet fetch = ProductProjectionByIdGet.of("id", ProductProjectionType.CURRENT); assertThat(fetch.expansionPaths()).isEmpty(); final ProductProjectionByIdGet fetch2 = fetch.plusExpansionPaths(ProductProjectionExpansionModel.of().categories()); assertThat(fetch.expansionPaths()).overridingErrorMessage("old object is unchanged").isEmpty(); assertThat(fetch2.expansionPaths()).isEqualTo(asList(ExpansionPath.of("categories[*]"))); assertThat(fetch2).isNotSameAs(fetch);See the test code.
plusExpansionPaths in interface ReferenceExpansionDsl<ProductProjection,ProductProjectionByIdGet>expansionPath - the new expansion path to add to the existing onesProductProjectionByIdGet withExpansionPaths(ExpansionPath<ProductProjection> expansionPath)
ReferenceExpansionDslexpansionPath.
An example in the product projection context:
final ProductProjectionByIdGet fetch = ProductProjectionByIdGet.of("id", ProductProjectionType.CURRENT) .withExpansionPaths(ProductProjectionExpansionModel.of().categories()); assertThat(fetch.expansionPaths()) .isEqualTo(asList(ExpansionPath.of("categories[*]"))); final ProductProjectionByIdGet fetch2 = fetch.withExpansionPaths(ProductProjectionExpansionModel.of().productType()); assertThat(fetch.expansionPaths()).overridingErrorMessage("old object is unchanged") .isEqualTo(asList(ExpansionPath.of("categories[*]"))); assertThat(fetch2.expansionPaths()).isEqualTo(asList(ExpansionPath.of("productType"))); assertThat(fetch2).isNotSameAs(fetch);See the test code.
This method also can be used to use the same expansions as in another request:
final ProductProjectionQuery query = ProductProjectionQuery.ofCurrent().withExpansionPaths(m -> m.categories()); final ProductProjectionSearch search = ProductProjectionSearch.ofCurrent().withExpansionPaths(query); assertThat(query.expansionPaths()) .hasSize(1) .as("reuse expansion spec from other request") .isEqualTo(search.expansionPaths());See the test code.
withExpansionPaths in interface ReferenceExpansionDsl<ProductProjection,ProductProjectionByIdGet>expansionPath - the new expansion pathsProductProjectionByIdGet withExpansionPaths(List<ExpansionPath<ProductProjection>> expansionPaths)
ReferenceExpansionDslexpansionPaths.withExpansionPaths in interface ReferenceExpansionDsl<ProductProjection,ProductProjectionByIdGet>expansionPaths - the new expansion paths