io.sphere.sdk.categories.commands.updateactions.ChangeParent Maven / Gradle / Ivy
package io.sphere.sdk.categories.commands.updateactions;
import io.sphere.sdk.categories.Category;
import io.sphere.sdk.commands.UpdateActionImpl;
import io.sphere.sdk.models.Reference;
import io.sphere.sdk.models.Referenceable;
/**
Sets a concrete parent for the category. Currently it is not possible int the API to remove the parent.
{@doc.gen intro}
{@include.example io.sphere.sdk.categories.commands.CategoryUpdateCommandTest#changeParent()}
Consult the documentation for categories for more information.
*/
public class ChangeParent extends UpdateActionImpl {
private final Reference parent;
private ChangeParent(final Referenceable parent) {
super("changeParent");
this.parent = parent.toReference().filled(null);
}
public static ChangeParent of(final Referenceable parent) {
return new ChangeParent(parent);
}
public Reference getParent() {
return parent;
}
}