io.sphere.sdk.states.relatedupdateactions.TransitionStateBase Maven / Gradle / Ivy
package io.sphere.sdk.states.relatedupdateactions;
import io.sphere.sdk.commands.UpdateActionImpl;
import io.sphere.sdk.models.Reference;
import io.sphere.sdk.models.Referenceable;
import io.sphere.sdk.states.State;
import javax.annotation.Nullable;
import java.util.Optional;
/**
* Internal base class
* @param type to be updated
*/
public abstract class TransitionStateBase extends UpdateActionImpl {
@Nullable
private final Reference state;
protected TransitionStateBase(final @Nullable Referenceable state) {
super("transitionState");
this.state = Optional.ofNullable(state).map(stateReferenceable -> stateReferenceable.toReference()).orElse(null);
}
@Nullable
public Reference getState() {
return state;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy