public class MemoryLocalStorage extends Object
Modifier and Type | Field and Description |
---|---|
private List<SyncCategory> |
categories |
private List<SyncCommodity> |
commodities |
private int |
localVersion |
private List<SyncOrder> |
orders |
private List<SyncProduct> |
products |
private SellerInfo |
seller |
private boolean |
sellerIsSynced |
private SyncVersionInfo |
syncInfo |
private List<SyncTax> |
taxes |
private List<SyncTreasurer> |
treasurers |
Constructor and Description |
---|
MemoryLocalStorage() |
private SellerInfo seller
private boolean sellerIsSynced
private List<SyncProduct> products
private List<SyncCategory> categories
private List<SyncCommodity> commodities
private List<SyncTreasurer> treasurers
private int localVersion
private SyncVersionInfo syncInfo
public SyncVersionInfo getSyncInfo()
public int getLocalVersion()
public SellerInfo getSeller()
public void setSeller(SellerInfo seller)
public boolean isSellerSynced()
public void setSellerSynced(boolean sellerSynced)
public List<SyncProduct> getProducts()
public void setProducts(List<SyncProduct> products)
public SyncProduct getProduct(int index)
public SyncProduct getProductByIdentifier(String identifier)
public List<SyncProduct> getProductsByTax(SyncTax tax)
public List<SyncProduct> getProductsByTaxIndex(int index)
public List<SyncProduct> getProductsByCategory(SyncCategory category)
public List<SyncProduct> getProductsByCategoryIndex(int index)
public void add(SyncProduct p)
public int delete(SyncProduct product, boolean forceDeleteRelated)
public SyncTax getTax(int index)
public SyncTax getTaxByVat(int vat)
public void add(SyncTax tax)
public int delete(SyncTax tax, boolean forceDeleteRelated)
public List<SyncCategory> getCategories()
public void setCategories(List<SyncCategory> categories)
public SyncCategory getCategory(int index)
public SyncCategory getCategoryByIdentifier(String identifier)
public void add(SyncCategory cat)
public int delete(SyncCategory cat, boolean forceDeleteRelated)
public List<SyncCommodity> getCommodities()
public void setCommodities(List<SyncCommodity> commodities)
public SyncCommodity getCommodity(int index)
public SyncCommodity getCommodityByIdentifier(String identifier)
public void add(SyncCommodity c)
public int delete(SyncCommodity c, boolean forceDeleteRelated)
public List<SyncTreasurer> getTreasurers()
public void setTreasurers(List<SyncTreasurer> treasurers)
public SyncTreasurer getTreasurer(int index)
public SyncTreasurer getTreasurerByIdentifier(String identifier)
public void add(SyncTreasurer t)
public int delete(SyncTreasurer t, boolean forceDeleteRelated)
public SyncTreasurer getTreasurerBySsn(String ssn)
public SyncTreasurer getTreasurerByName(String name)
public SyncOrder getOrder(int index)
public void add(SyncOrder order)
public int delete(SyncOrder order, boolean forceDeleteRelated)
public boolean isSupersetOf(MemoryLocalStorage storage)
Simple check if current storage object is a superset of other memory storage (contains everything from other storage).
Does not compare full contents of entities, compares just entity identifiers. Ignores deleted entities.
storage
- MemoryLocalStorage to compare withpublic boolean isEqualTo(MemoryLocalStorage storage)
Simple compare of two memory storages.
Compares just entity identifiers. Ignores deleted entities.
storage
- MemoryLocalStorage to compare withCopyright © 2016. All rights reserved.