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

io.sphere.sdk.carts.ItemState Maven / Gradle / Ivy

There is a newer version: 2.16.0
Show newest version
package io.sphere.sdk.carts;

import com.fasterxml.jackson.annotation.JsonCreator;
import io.sphere.sdk.models.Base;
import io.sphere.sdk.models.Reference;
import io.sphere.sdk.models.Referenceable;
import io.sphere.sdk.states.State;

public final class ItemState extends Base {
    private final Reference state;
    private final Long quantity;

    @JsonCreator
    private ItemState(final Reference state, final Long quantity) {
        this.state = state;
        this.quantity = quantity;
    }

    public static ItemState of(final Referenceable state, final long quantity) {
        return new ItemState(state.toReference(), quantity);
    }

    public Long getQuantity() {
        return quantity;
    }

    public Reference getState() {
        return state;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy