T - the type of the result of the commandpublic abstract class MetaModelByIdDeleteCommandImpl<T extends ResourceView<T,T>,C,E> extends CommandImpl<T> implements MetaModelExpansionDslExpansionModelRead<T,C,E>, DeleteCommand<T>
| Modifier | Constructor and Description |
|---|---|
protected |
MetaModelByIdDeleteCommandImpl(MetaModelByIdDeleteCommandBuilder<T,C,E> builder) |
protected |
MetaModelByIdDeleteCommandImpl(Versioned<T> versioned,
boolean eraseData,
com.fasterxml.jackson.databind.JavaType javaType,
String endpoint,
E expansionModel,
List<ExpansionPath<T>> expansionPaths,
Function<MetaModelByIdDeleteCommandBuilder<T,C,E>,C> creationFunction) |
protected |
MetaModelByIdDeleteCommandImpl(Versioned<T> versioned,
boolean eraseData,
JsonEndpoint<T> endpoint,
E expansionModel,
Function<MetaModelByIdDeleteCommandBuilder<T,C,E>,C> creationFunction) |
protected |
MetaModelByIdDeleteCommandImpl(Versioned<T> versioned,
JsonEndpoint<T> endpoint,
E expansionModel,
Function<MetaModelByIdDeleteCommandBuilder<T,C,E>,C> creationFunction) |
| Modifier and Type | Method and Description |
|---|---|
protected MetaModelByIdDeleteCommandBuilder<T,C,E> |
copyBuilder() |
E |
expansionModel() |
List<ExpansionPath<T>> |
expansionPaths() |
HttpRequestIntent |
httpRequestIntent()
Provides an http request intent, this does not include the execution of it.
|
protected com.fasterxml.jackson.databind.JavaType |
jacksonJavaType() |
C |
plusExpansionPaths(ExpansionPath<T> expansionPath)
Creates a new object with the properties of the old object but adds
expansionPath to the expansion paths. |
C |
plusExpansionPaths(Function<E,ExpansionPathContainer<T>> m)
Creates a new object with the properties of the old object but adds a new expansion path to it by using meta models.
|
C |
plusExpansionPaths(List<ExpansionPath<T>> expansionPaths)
Creates a new object with the properties of the old object but adds
expansionPaths to the expansion paths. |
C |
plusExpansionPaths(String expansionPath)
Creates a new object with the properties of the old object but adds
expansionPath to the expansion paths. |
C |
withExpansionPaths(ExpansionPath<T> expansionPath)
Creates a new object with the properties of the old object but replaces all expansion paths with a single
expansionPath. |
C |
withExpansionPaths(Function<E,ExpansionPathContainer<T>> m)
Creates a new object with the properties of the old object but replaces all expansion paths with a single
expansionPath by using meta models. |
C |
withExpansionPaths(List<ExpansionPath<T>> expansionPaths)
Creates a new object with the properties of the old object but replaces all expansion paths with
expansionPaths. |
C |
withExpansionPaths(String expansionPath)
Creates a new object with the properties of the old object but replaces all expansion paths with a single
expansionPath. |
deserializeclone, finalize, getClass, notify, notifyAll, wait, wait, waitplusExpansionPaths, withExpansionPathscanDeserialize, deserializeprotected MetaModelByIdDeleteCommandImpl(Versioned<T> versioned, boolean eraseData, com.fasterxml.jackson.databind.JavaType javaType, String endpoint, E expansionModel, List<ExpansionPath<T>> expansionPaths, Function<MetaModelByIdDeleteCommandBuilder<T,C,E>,C> creationFunction)
protected MetaModelByIdDeleteCommandImpl(Versioned<T> versioned, JsonEndpoint<T> endpoint, E expansionModel, Function<MetaModelByIdDeleteCommandBuilder<T,C,E>,C> creationFunction)
protected MetaModelByIdDeleteCommandImpl(Versioned<T> versioned, boolean eraseData, JsonEndpoint<T> endpoint, E expansionModel, Function<MetaModelByIdDeleteCommandBuilder<T,C,E>,C> creationFunction)
protected MetaModelByIdDeleteCommandImpl(MetaModelByIdDeleteCommandBuilder<T,C,E> builder)
public HttpRequestIntent httpRequestIntent()
SphereRequesthttpRequestIntent in interface SphereRequest<T extends ResourceView<T,T>>protected com.fasterxml.jackson.databind.JavaType jacksonJavaType()
jacksonJavaType in class CommandImpl<T extends ResourceView<T,T>>public List<ExpansionPath<T>> expansionPaths()
expansionPaths in interface ExpansionPathContainer<T extends ResourceView<T,T>>expansionPaths in interface ReferenceExpansionSupport<T extends ResourceView<T,T>>public final C withExpansionPaths(List<ExpansionPath<T>> expansionPaths)
ReferenceExpansionDslexpansionPaths.withExpansionPaths in interface ReferenceExpansionDsl<T extends ResourceView<T,T>,C>expansionPaths - the new expansion pathspublic C withExpansionPaths(ExpansionPath<T> 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<T extends ResourceView<T,T>,C>expansionPath - the new expansion pathspublic C withExpansionPaths(Function<E,ExpansionPathContainer<T>> m)
MetaModelReferenceExpansionDslexpansionPath by using meta models.
An example in the product projection context:
final ProductProjectionByIdGet fetch = ProductProjectionByIdGet.of("id", ProductProjectionType.CURRENT) .plusExpansionPaths(ProductProjectionExpansionModel.of().categories()); assertThat(fetch.expansionPaths()) .isEqualTo(asList(ExpansionPath.of("categories[*]"))); final ProductProjectionByIdGet fetch2 = fetch.withExpansionPaths(m -> m.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.
withExpansionPaths in interface MetaModelReferenceExpansionDsl<T extends ResourceView<T,T>,C,E>m - function to use the meta model for expansions to create an expansion pathpublic C plusExpansionPaths(List<ExpansionPath<T>> expansionPaths)
ReferenceExpansionDslexpansionPaths to the expansion paths.plusExpansionPaths in interface ReferenceExpansionDsl<T extends ResourceView<T,T>,C>expansionPaths - the new expansion paths to add to the existing onespublic C plusExpansionPaths(ExpansionPath<T> 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<T extends ResourceView<T,T>,C>expansionPath - the new expansion path to add to the existing onespublic C plusExpansionPaths(Function<E,ExpansionPathContainer<T>> m)
MetaModelReferenceExpansionDslAn example in the product projection context:
final ProductProjectionByIdGet fetch1 = ProductProjectionByIdGet.of("id", ProductProjectionType.CURRENT) .plusExpansionPaths(m -> m.categories()); assertThat(fetch1.expansionPaths()) .isEqualTo(asList(ExpansionPath.of("categories[*]"))); final ProductProjectionByIdGet fetch2 = fetch1.plusExpansionPaths(m -> m.productType()); assertThat(fetch2.expansionPaths()) .isEqualTo(asList(ExpansionPath.of("categories[*]"), ExpansionPath.of("productType"))) .isEqualTo(listOf(fetch1.expansionPaths(), ExpansionPath.of("productType"))); //this is equivalent to final ExpansionPath<ProductProjection> categoryExpand = ProductProjectionExpansionModel.of().categories().expansionPaths().get(0); final ExpansionPath<ProductProjection> productTypeExpand = ProductProjectionExpansionModel.of().productType().expansionPaths().get(0); final ProductProjectionByIdGet fetchB = ProductProjectionByIdGet.of("id", ProductProjectionType.CURRENT) .withExpansionPaths(asList(categoryExpand, productTypeExpand)); assertThat(fetchB.expansionPaths()) .isEqualTo(asList(ExpansionPath.of("categories[*]"), ExpansionPath.of("productType")));See the test code.
plusExpansionPaths in interface MetaModelReferenceExpansionDsl<T extends ResourceView<T,T>,C,E>m - function to use the meta model for expansions to create an expansion pathpublic C withExpansionPaths(String 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<T extends ResourceView<T,T>,C>expansionPath - the new expansion pathspublic C plusExpansionPaths(String 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<T extends ResourceView<T,T>,C>expansionPath - the new expansion path to add to the existing onespublic E expansionModel()
expansionModel in interface MetaModelExpansionDslExpansionModelRead<T extends ResourceView<T,T>,C,E>protected MetaModelByIdDeleteCommandBuilder<T,C,E> copyBuilder()