public final class ChangeParent extends UpdateActionImpl<Category>
See also CategoryUpdateCommand.
withCategory(client(), categoryA -> withCategory(client(), categoryB -> { assertThat(categoryA.getParent()).isNull(); assertThat(categoryB.getParent()).isNull(); final CategoryUpdateCommand updateCommand = CategoryUpdateCommand.of(categoryB, ChangeParent.of(categoryA)) .plusExpansionPaths(m -> m.parent()); final Category updatedB = client().executeBlocking(updateCommand); assertThat(updatedB.getParent().getId()).isEqualTo(categoryA.getId()); assertThat(updatedB.getParent().getObj()).isNotNull().isEqualTo(categoryA); }) );
See the test code.
Consult the documentation for categories for more information.
Modifier and Type | Method and Description |
---|---|
ResourceIdentifier<Category> |
getParent() |
static ChangeParent |
of(Referenceable<Category> parent) |
static ChangeParent |
of(ResourceIdentifier<Category> parent) |
getAction
public static ChangeParent of(Referenceable<Category> parent)
public static ChangeParent of(ResourceIdentifier<Category> parent)
public ResourceIdentifier<Category> getParent()