QualificationDiscountDef Interface
- public interface QualificationDiscountDef
extends Comparable, Serializable
This interface defines the public interface of an immutable discount
definition object. Discount definition objects are the run time
representation of a discount. Discount are defined in XML discount set
definitions. The QualDiscountDefFactory is used to create
instance of discount definition objects from the discount set definition
-
All Superinterfaces
-
Comparable, Serializable
ITEM_DISCOUNT_TYPE
public static final String ITEM_DISCOUNT_TYPE
- Defines the item discount type
ORDER_DISCOUNT_TYPE
public static final String ORDER_DISCOUNT_TYPE
- Defines the order discount type
equals(Object) Method
public boolean equals(Object obj)
Tests if two discounts are the same
-
Overrides
-
Object.equals(Object)
Parameters
-
obj
- the
QualificationDiscountDef to compare this one
against
Returns
- true if the passed
QualificationDiscountDef is the
same as this one
getAllowedUses() Method
public int getAllowedUses()
Gets the value of the 'number of uses allowed' parameter for this
discount. This is the number of orders the discount may be applied to for
a given user. The value must be positive.
Returns
- the number of uses allowed
getDescription() Method
public String getDescription()
Gets this discount's description
Returns
- this discount's description
getEndDate() Method
public Date getEndDate()
Gets the discount definition's expiration date
Returns
- a Date, the discount's expiration date
getGlobalDescription() Method
public String getGlobalDescription()
Gets this discount's global description
Returns
- this discount's global description
getId() Method
public QualificationDiscountId getId()
Get the QualificationDiscountId (unique identifier)
associated with this definition
Returns
- this discounts id (
QualificationDiscountId)
getModifier() Method
public DiscountModifier getModifier()
Gets the DiscountModifier associated with this discount
Returns
- the
DiscountModifier associated with this discount
Related Topics
DiscountModifier
getName() Method
public String getName()
Gets this discounts name, discount names are only unique within a given
discount set
Returns
- this discount's name
Related Topics
QualificationDiscountDef.getSetName()
getPriority() Method
public int getPriority()
Gets the priority associated with this definition
Returns
- this discount's priority
getRule() Method
public DiscountRule getRule()
Gets the DiscountRule associated with this discount
Returns
- the
DiscountRule associated with this discount
Related Topics
DiscountRule
getSetName() Method
DEPRECATED As of version 4.0, this method now throws an
UnsupportedOperationException.
public String getSetName()
Gets the name of the discount set this discount was defined in
Returns
- this discount's set name
getStartDate() Method
public Date getStartDate()
Gets the discount definition's begin date
Returns
- a Date, the discount's begin date
getType() Method
public String getType()
Gets the type of this discount, should be one of the discount type
constants defined by this interface
Returns
- this discount's type
hashCode() Method
public int hashCode()
A unique code for this discount
-
Overrides
-
Object.hashCode()
Returns
- the hashCode for this discount
isActive() Method
public boolean isActive()
Gets this discount's active flag
Returns
- true if the discount is active, false otherwise
isGlobal() Method
public boolean isGlobal()
Gets this discount's global flag
Returns
- ture if this is a global discount, flase otherwise
setId(QualificationDiscountId) Method
public void setId(QualificationDiscountId newId)
toString() Method
public String toString()
Gets a String representation of this discount
-
Overrides
-
Object.toString()
Returns
- a
String representation of this discount