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

io.sphere.sdk.states.relatedupdateactions.TransitionStateBase Maven / Gradle / Ivy

There is a newer version: 1.0.0-M26
Show newest version
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