@Override
  public void validate() {
    genClient.validateLength(getId(), 13);

    genClient.validateLength(getVersionName(), 255);

    genClient.validateLength(getHash(), 64);

    genClient.validateLength(getHashOriginal(), 64);
  }
Example #2
0
 /** Constructs a new instance from the given JSON String. */
 public Item(String json) throws IllegalArgumentException {
   try {
     genClient.setJsonObject(new org.json.JSONObject(json));
   } catch (org.json.JSONException e) {
     throw new IllegalArgumentException("invalid json", e);
   }
 }
Example #3
0
  @Override
  public void validate() {
    genClient.validateLength(getId(), 13);

    genClient.validateNull(getName(), "name");
    genClient.validateLength(getName(), 127);

    genClient.validateLength(getAlternateName(), 127);

    genClient.validateLength(getCode(), 100);

    genClient.validateLength(getSku(), 100);

    genClient.validateNull(getPrice(), "price");
    if (getPrice() != null && (getPrice() < 0))
      throw new IllegalArgumentException("Invalid value for 'getPrice()'");

    genClient.validateLength(getUnitName(), 64);
  }
Example #4
0
 @Override
 public String toString() {
   return genClient.toString();
 }
Example #5
0
 /** Copy all the changed fields from the given source to this instance. */
 public void mergeChanges(Item src) {
   if (src.genClient.getChangeLog() != null) {
     genClient.mergeChanges(new Item(src).getJSONObject(), src.genClient);
   }
 }
Example #6
0
 /** Returns true if this instance has any changes. */
 public boolean containsChanges() {
   return genClient.containsChanges();
 }
Example #7
0
 /** Clears the 'itemStock' field, the 'has' method for this field will now return false */
 public void clearItemStock() {
   genClient.clear(CacheKey.itemStock);
 }
Example #8
0
 /** Clears the 'categories' field, the 'has' method for this field will now return false */
 public void clearCategories() {
   genClient.clear(CacheKey.categories);
 }
Example #9
0
 /** Clears the 'taxRates' field, the 'has' method for this field will now return false */
 public void clearTaxRates() {
   genClient.clear(CacheKey.taxRates);
 }
Example #10
0
 /** Clears the 'name' field, the 'has' method for this field will now return false */
 public void clearName() {
   genClient.clear(CacheKey.name);
 }
Example #11
0
 /** Clears the 'itemGroup' field, the 'has' method for this field will now return false */
 public void clearItemGroup() {
   genClient.clear(CacheKey.itemGroup);
 }
Example #12
0
 /** Clears the 'hidden' field, the 'has' method for this field will now return false */
 public void clearHidden() {
   genClient.clear(CacheKey.hidden);
 }
Example #13
0
 /** Clears the 'id' field, the 'has' method for this field will now return false */
 public void clearId() {
   genClient.clear(CacheKey.id);
 }
Example #14
0
 /** Sets the field 'modifiedTime'. */
 public Item setModifiedTime(java.lang.Long modifiedTime) {
   return genClient.setOther(modifiedTime, CacheKey.modifiedTime);
 }
Example #15
0
 /**
  * Sets the field 'itemStock'.
  *
  * <p>The parameter is not copied so changes to it will be reflected in this instance and
  * vice-versa.
  */
 public Item setItemStock(com.clover.sdk.v3.inventory.ItemStock itemStock) {
   return genClient.setRecord(itemStock, CacheKey.itemStock);
 }
Example #16
0
 /** Clears the 'isRevenue' field, the 'has' method for this field will now return false */
 public void clearIsRevenue() {
   genClient.clear(CacheKey.isRevenue);
 }
Example #17
0
 /** Clears the 'stockCount' field, the 'has' method for this field will now return false */
 public void clearStockCount() {
   genClient.clear(CacheKey.stockCount);
 }
Example #18
0
 /** Clears the 'alternateName' field, the 'has' method for this field will now return false */
 public void clearAlternateName() {
   genClient.clear(CacheKey.alternateName);
 }
Example #19
0
 /** Clears the 'modifierGroups' field, the 'has' method for this field will now return false */
 public void clearModifierGroups() {
   genClient.clear(CacheKey.modifierGroups);
 }
Example #20
0
 /** Clears the 'code' field, the 'has' method for this field will now return false */
 public void clearCode() {
   genClient.clear(CacheKey.code);
 }
Example #21
0
 /** Clears the 'tags' field, the 'has' method for this field will now return false */
 public void clearTags() {
   genClient.clear(CacheKey.tags);
 }
Example #22
0
 /** Clears the 'sku' field, the 'has' method for this field will now return false */
 public void clearSku() {
   genClient.clear(CacheKey.sku);
 }
Example #23
0
 /** Clears the 'modifiedTime' field, the 'has' method for this field will now return false */
 public void clearModifiedTime() {
   genClient.clear(CacheKey.modifiedTime);
 }
Example #24
0
 /** Clears the 'priceType' field, the 'has' method for this field will now return false */
 public void clearPriceType() {
   genClient.clear(CacheKey.priceType);
 }
Example #25
0
 /**
  * Reset the log of changes made to this instance, calling copyChanges() after this would return
  * an empty instance.
  */
 public void resetChangeLog() {
   genClient.resetChangeLog();
 }
Example #26
0
 /** Clears the 'defaultTaxRates' field, the 'has' method for this field will now return false */
 public void clearDefaultTaxRates() {
   genClient.clear(CacheKey.defaultTaxRates);
 }
Example #27
0
 /**
  * Gets a Bundle which can be used to get and set data attached to this instance. The attached
  * Bundle will be parcelled but not jsonified.
  */
 public android.os.Bundle getBundle() {
   return genClient.getBundle();
 }
Example #28
0
 /** Clears the 'unitName' field, the 'has' method for this field will now return false */
 public void clearUnitName() {
   genClient.clear(CacheKey.unitName);
 }
Example #29
0
 @Override
 public void writeToParcel(android.os.Parcel dest, int flags) {
   genClient.writeToParcel(dest, flags);
 }
Example #30
0
 /** Clears the 'cost' field, the 'has' method for this field will now return false */
 public void clearCost() {
   genClient.clear(CacheKey.cost);
 }