
com.activitystream.aspects.InventoryAspect Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sdk Show documentation
Show all versions of sdk Show documentation
For a description please see https://github.com/activitystream/as-sdk-java
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