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

de.escalon.hypermedia.sample.beans.store.Offer Maven / Gradle / Ivy

package de.escalon.hypermedia.sample.beans.store;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import org.springframework.hateoas.ResourceSupport;
import org.springframework.hateoas.core.Relation;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Currency;
import java.util.List;

/**
 * Created by Dietrich on 17.02.2015.
 *
 */
@JsonPropertyOrder({"itemOffered", "price", "priceCurrency", "addOns"})
@Relation("offer")
public class Offer extends ResourceSupport {
    private Product itemOffered;
    private BigDecimal price;
    private List addOns = new ArrayList();
    private Currency priceCurrency;

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public Currency getPriceCurrency() {
        return priceCurrency;
    }

    public void setPriceCurrency(Currency priceCurrency) {
        this.priceCurrency = priceCurrency;
    }

    public Product getItemOffered() {
        return itemOffered;
    }

    public void setItemOffered(Product itemOffered) {
        this.itemOffered = itemOffered;
    }

    @JsonInclude(JsonInclude.Include.NON_DEFAULT)
    public List getAddOns() {
        return addOns;
    }

    public void addOn(Offer addOn) {
        this.addOns.add(addOn);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy