All Downloads are FREE. Search and download functionalities are using the official Maven repository.

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.ResourceIdentifiable;
import io.sphere.sdk.models.ResourceIdentifier;
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 ResourceIdentifier state;

    protected TransitionStateBase(final @Nullable ResourceIdentifiable state) {
        super("transitionState");
        this.state = Optional.ofNullable(state).map(ResourceIdentifiable::toResourceIdentifier).orElse(null);
    }

    @Nullable
    public ResourceIdentifier getState() {
        return state;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy