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

io.sphere.sdk.states.State Maven / Gradle / Ivy

There is a newer version: 1.0.0-M26
Show newest version
package io.sphere.sdk.states;


import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import io.sphere.sdk.models.LocalizedString;
import io.sphere.sdk.models.Resource;
import io.sphere.sdk.models.Reference;

import javax.annotation.Nullable;
import java.util.Set;

/** A State represents a state of a particular resource (defines a finite state machine). States can be combined together
    by defining transitions between each state, thus allowing to create work-flows.
    Each project has by default an initial LineItemState (inherited also by custom Line Items)

 

Operations:

  • Create a state with {@link io.sphere.sdk.states.commands.StateCreateCommand}.
  • Query a state with {@link io.sphere.sdk.states.queries.StateQuery}.
  • Delete a channel with {@link io.sphere.sdk.states.commands.StateDeleteCommand}.
*/ @JsonDeserialize(as = StateImpl.class) public interface State extends Resource { String getKey(); StateType getType(); @Nullable LocalizedString getName(); @Nullable LocalizedString getDescription(); Boolean isInitial(); Boolean isBuiltIn(); @Nullable Set> getTransitions(); default Reference toReference() { return Reference.of(referenceTypeId(), getId(), this); } static String referenceTypeId() { return "state"; } /** * * @deprecated use {@link #referenceTypeId()} instead * @return referenceTypeId */ @Deprecated static String typeId(){ return "state"; } static TypeReference typeReference(){ return new TypeReference() { @Override public String toString() { return "TypeReference"; } }; } static Reference referenceOfId(final String id) { return Reference.of(referenceTypeId(), id); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy