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

com.activitystream.aspects.InventoryAspect Maven / Gradle / Ivy

Go to download

For a description please see https://github.com/activitystream/as-sdk-java

There is a newer version: 0.5.8
Show newest version
package com.activitystream.aspects;

import java.util.*;

public class InventoryAspect extends AspectBase {

    //private List items = new ArrayList<>();
    private List items = new ArrayList<>();

    public InventoryAspect() {
        aspectPropertyMap.put("inventory.items_in_stock", new AspectProperty(IsRequired.False));
        aspectPropertyMap.put("inventory.items_for_sale", new AspectProperty(IsRequired.False));
        aspectPropertyMap.put("inventory.items_sold", new AspectProperty(IsRequired.False));
        aspectPropertyMap.put("inventory.price_categories", new AspectProperty(IsRequired.False));
    }

    public InventoryAspect itemsInStock(Double itemsInStock) {
        aspectPropertyMap.get("inventory.items_in_stock").value = itemsInStock;
        return this;
    }

    public InventoryAspect itemsForSale(Double itemsForSale) {
        aspectPropertyMap.get("inventory.items_for_sale").value = itemsForSale;
        return this;
    }

    public InventoryAspect itemsSold(Double itemsSold) {
        aspectPropertyMap.get("inventory.items_sold").value = itemsSold;
        return this;
    }

    public InventoryAspect addPriceCategory(PriceCategoryInventoryAspect pc) {
        this.items.add(pc.toJson());
        aspectPropertyMap.get("inventory.price_categories").value = this.items;
        return this;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy