public class ShippingRuleVariant extends DBObject
DBObject.DenormalizeAction
Modifier and Type | Field and Description |
---|---|
static GlobalId |
DBCLASS_GID
Shipping Rule Variants
|
static java.lang.String |
DBCLASS_NAME
Shipping Rule Variants
|
ATTRIBUTE_MARVIN, dbClass, ds, NO_LOOP_PARAMS
Constructor and Description |
---|
ShippingRuleVariant(DBClass theClass,
DataSource dataSource) |
Modifier and Type | Method and Description |
---|---|
static boolean |
canShip(DataSource datasource,
double weight,
double length,
double width,
double height) |
static ShippingRuleVariant |
create(MutableDataSource mds)
Make a new instance of this class.
|
static ShippingRuleVariant |
findKey(DataSource ds,
int key)
Find the target for this class by the primary key
|
ShippingRule |
findRule(java.lang.String... args)
Shipping Rule.
|
int |
getID(java.lang.String... args) |
double |
getMaxWeight(java.lang.String... args) |
double |
getMinProductPrice(java.lang.String... args) |
double |
getPrice(java.lang.String... args) |
ShippingRule |
getRule(java.lang.String... args) |
static java.util.HashMap<ShippingRule,PackingMethod> |
getShippingCost(DataSource ds,
java.util.ArrayList<ShippingProductInfo> list,
double price,
java.lang.String suburb,
java.lang.String state,
java.lang.String country) |
static java.util.HashMap<ShippingRule,PackingMethod> |
getShippingCost(DataSource ds,
java.util.ArrayList<ShippingProductInfo> list,
double price,
java.lang.String suburb,
java.lang.String state,
java.lang.String country,
Region region)
find all matching shipping rules
|
static java.util.HashMap<ShippingRule,PackingMethod> |
getShippingCost(DataSource ds,
java.util.ArrayList<ShippingProductInfo> list,
java.lang.String suburb,
java.lang.String state,
java.lang.String country) |
static java.util.HashMap<ShippingRule,PackingMethod> |
getShippingCost(DataSource ds,
java.util.ArrayList<ShippingProductInfo> list,
java.lang.String suburb,
java.lang.String state,
java.lang.String country,
Region region) |
static java.util.ArrayList<Package> |
getVariants(ShippingProductInfo[] infos,
ShippingRuleVariant[] variants)
This method should NOT be used by any class other than ShippingRuleVariant,
The reason that I don't set this method to private is there is one test case
testing this method
this method tries to find a cheapest way to pack all items
steps:
1.
|
static java.util.ArrayList<Package> |
getVariantsV2(ShippingProductInfo[] infos,
ShippingRuleVariant[] variants) |
double |
getX(java.lang.String... args) |
double |
getY(java.lang.String... args) |
double |
getZ(java.lang.String... args) |
boolean |
isInactive(java.lang.String... args) |
static DBQuery<ShippingRuleVariant> |
makeQuery(DataSource ds)
Make a new QUERY for this class.
|
ShippingRuleVariant |
setID(int value,
java.lang.String... args) |
ShippingRuleVariant |
setInactive(boolean value,
java.lang.String... args) |
ShippingRuleVariant |
setMaxWeight(double value,
java.lang.String... args) |
ShippingRuleVariant |
setMinProductPrice(double value,
java.lang.String... args) |
ShippingRuleVariant |
setPrice(double value,
java.lang.String... args) |
ShippingRuleVariant |
setRule(com.aspc.dal.cms.cart.ShippingRule value,
java.lang.String... args) |
ShippingRuleVariant |
setX(double value,
java.lang.String... args) |
ShippingRuleVariant |
setY(double value,
java.lang.String... args) |
ShippingRuleVariant |
setZ(double value,
java.lang.String... args) |
java.lang.String |
toString()
The description.
|
addReloadEventListener, archiveCheck, autoEnterCreate, calculateValue, calculateValue, calculateValue, callingRestoreByJournal, changeThreadMode, checkCreateAccess, checkDelete, checkDeleteAccess, checkModifyAccess, checkModifyAccess, checkReadAccess, clearCache, copy, copyFields, copyIncludeField, copyInwardLinks, delete, denormalizedResult, displayLogName, displayName, displayValue, doSearch, dump, equals, eventDataLoaded, eventFieldUpdated, extAutoEnterCreate, extCanDeleteDependantObject, extCheckCreateAccess, extCheckDeleteAccess, extCheckModifyAccess, extCheckModifyAccess, extCheckReadAccess, extCopy, extDelete, extDeleteRecord, extFixUp, extGetDerivedGlobalKey, extGetDerivedValue, extGetValue, extIsMandatory, extIsOnChange, extMarkSavePoint, extPostDeleteRecord, extPostSaveRecord, extPreDeleteRecord, extPreSaveRecord, extPreValidate, extPreValidateDelete, extRaiseEvents, extRollbackTo, extSaveRecord, extSetValue, extUndelete, extValidateDelete, extValidateField, extValidateRecord, fetchLinkHolder, findGlobalKey, findGlobalKey, findGlobalKey, findGlobalKey, findLinkedObject, findLinkedObject, findLinkedObject, findRawData, fireEventDataLoaded, fixUp, forceLockedTransaction, getBoolean, getBoolean, getBoolean, getBoolean, getBoolean, getBoolean, getChangedFieldInfo, getChangedFields, getDate, getDate, getDate, getDate, getDate, getDefaultValue, getDisableOnChangeEvent, getDouble, getDouble, getDouble, getDouble, getDouble, getFieldDouble, getFieldInt, getFieldLong, getFieldString, getFormattedString, getFormattedString, getGlobalKey, getGlobalKey, getGlobalKey, getGlobalKey, getGlobalKey, getInt, getInt, getInt, getInt, getInt, getInt, getInwardLinkage, getKeyString, getKeyValue, getLinkedObject, getLinkedObject, getLinkedObject, getLinkedObjectByKey, getLinkedRowId, getLinkedRowId, getLinkedRowIdByData, getLinkHolder, getLockedTransaction, getLong, getLong, getLong, getLong, getLong, getLong, getMutableArrayValue, getMutableArrayValue, getOriginalKey, getOriginalValue, getOriginalValue, getProcessedValue, getPureValue, getRawData, getRawValue, getRawValue, getRowId, getRowKey, getSecondaryCacheGroupKey, getSrcLayerID, getString, getString, getString, getString, getString, getString, getValue, getValue, getValue, getValue, hasAutoChanged, hasAutoChanged, hasChanged, hasChangedByUser, hasChangedByUserField, hasChangedByUserField, hasFieldChanged, hasFieldChanged, hashCode, hasStoredResult, iCheckDeleteAccess, iCheckModifyAccess, iCheckReadAccess, iGetDenormalizedMap, iGetRawValue, iPlaceDenormalizedResult, iPostSaveOrDeleteRecord, iPreSaveOrDeleteRecord, iPreValidate, iRaiseEvents, iSaveOrDeleteRecord, isBrokenLink, isBrokenLink, isChanged, isDataCacheKnownToBeDirty, isDeleted, isEmpty, iSetValue, isForceReindex, isKeyWordField, isMandatory, isNew, isNull, isNull, isOnChange, isReindex, iValidateRecord, lastTouched, makeArchiveDataLoader, makeClone, makeDataLoader, makeDenormalizedDoc, makeLinkedArray, makeModifyAccessException, makeSearchPlan, makeWriteProvider, manualDenormalizeOnSave, markSavePoint, optLockedTransaction, registerWatchedObject, reindex, releaseDenormalized, removeReloadEventListener, restoreByJournal, rollbackTo, setBoolean, setBoolean, setBoolean, setBoolean, setDisableOnChangeEvent, setDouble, setDouble, setInt, setInt, setLong, setLong, setRawData, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, touch, undelete, validateField, validateRecord, validateSubType
public static final java.lang.String DBCLASS_NAME
public static final GlobalId DBCLASS_GID
public ShippingRuleVariant(DBClass theClass, DataSource dataSource) throws java.lang.Exception
java.lang.Exception
@CheckReturnValue public int getID(java.lang.String... args)
@Nonnull public ShippingRuleVariant setID(int value, java.lang.String... args) throws java.lang.Exception
java.lang.Exception
@CheckReturnValue public boolean isInactive(java.lang.String... args)
@Nonnull public ShippingRuleVariant setInactive(boolean value, java.lang.String... args) throws java.lang.Exception
java.lang.Exception
@CheckReturnValue @Nonnegative public double getMaxWeight(java.lang.String... args)
@Nonnull public ShippingRuleVariant setMaxWeight(double value, java.lang.String... args) throws java.lang.Exception
java.lang.Exception
@CheckReturnValue @Nonnegative public double getMinProductPrice(java.lang.String... args)
@Nonnull public ShippingRuleVariant setMinProductPrice(double value, java.lang.String... args) throws java.lang.Exception
java.lang.Exception
@CheckReturnValue @Nonnegative public double getPrice(java.lang.String... args)
@Nonnull public ShippingRuleVariant setPrice(double value, java.lang.String... args) throws java.lang.Exception
java.lang.Exception
@CheckReturnValue @Nullable public ShippingRule getRule(java.lang.String... args)
@CheckReturnValue @Nonnull public final ShippingRule findRule(java.lang.String... args) throws NotFoundException
ShippingRule
(Integer,
Mandatory, Searchable)args
- the optional argumentsNotFoundException
- ShippingRule was not found@Nonnull public ShippingRuleVariant setRule(com.aspc.dal.cms.cart.ShippingRule value, java.lang.String... args) throws java.lang.Exception
java.lang.Exception
@CheckReturnValue public double getX(java.lang.String... args)
@Nonnull public ShippingRuleVariant setX(double value, java.lang.String... args) throws java.lang.Exception
java.lang.Exception
@CheckReturnValue public double getY(java.lang.String... args)
@Nonnull public ShippingRuleVariant setY(double value, java.lang.String... args) throws java.lang.Exception
java.lang.Exception
@CheckReturnValue public double getZ(java.lang.String... args)
@Nonnull public ShippingRuleVariant setZ(double value, java.lang.String... args) throws java.lang.Exception
java.lang.Exception
@Nonnull @CheckReturnValue public static ShippingRuleVariant create(@Nonnull MutableDataSource mds) throws java.lang.Exception
mds
- the datasourcejava.lang.Exception
- an object of this class could not be created@Nonnull @CheckReturnValue public static DBQuery<ShippingRuleVariant> makeQuery(@Nonnull DataSource ds) throws NotFoundException
ds
- the datasourceNotFoundException
- if class could not be found@Nonnull @CheckReturnValue public static ShippingRuleVariant findKey(@Nonnull DataSource ds, int key) throws NotFoundException, java.lang.Exception
ds
- the datasourcekey
- the valueNotFoundException
- if target could not be foundjava.lang.Exception
- a serious problem@CheckReturnValue @Nonnull public java.lang.String toString()
DBObject
public static boolean canShip(DataSource datasource, double weight, double length, double width, double height) throws java.lang.Exception
java.lang.Exception
public static java.util.HashMap<ShippingRule,PackingMethod> getShippingCost(DataSource ds, java.util.ArrayList<ShippingProductInfo> list, java.lang.String suburb, java.lang.String state, java.lang.String country) throws java.lang.Exception
java.lang.Exception
public static java.util.HashMap<ShippingRule,PackingMethod> getShippingCost(DataSource ds, java.util.ArrayList<ShippingProductInfo> list, double price, java.lang.String suburb, java.lang.String state, java.lang.String country) throws java.lang.Exception
java.lang.Exception
public static java.util.HashMap<ShippingRule,PackingMethod> getShippingCost(DataSource ds, java.util.ArrayList<ShippingProductInfo> list, java.lang.String suburb, java.lang.String state, java.lang.String country, Region region) throws java.lang.Exception
java.lang.Exception
public static java.util.HashMap<ShippingRule,PackingMethod> getShippingCost(DataSource ds, java.util.ArrayList<ShippingProductInfo> list, double price, java.lang.String suburb, java.lang.String state, java.lang.String country, Region region) throws java.lang.Exception
ds
- list
- price
- suburb
- state
- country
- region
- java.lang.Exception
public static java.util.ArrayList<Package> getVariants(ShippingProductInfo[] infos, ShippingRuleVariant[] variants)
infos
- all product items, sorted by weight desc, any item must fit at least one variantvariants
- all variants, sorted by price, we think higher price always has the higher weight capabilitypublic static java.util.ArrayList<Package> getVariantsV2(ShippingProductInfo[] infos, ShippingRuleVariant[] variants)
stSoftware Copyright © 2001-2014 stSoftware All Rights Reserved.