© 2002 BEA Systems, Inc.


com.bea.commerce.ebusiness.discount.mgmt
Interface QualificationDiscountDef


public interface QualificationDiscountDef
extends java.io.Serializable, java.lang.Comparable

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

See Also:
com.bea.commerce.ebusiness.discount.mgmt.QualDiscountDefFactory

Field Summary
static java.lang.String ITEM_DISCOUNT_TYPE
          Defines the item discount type
static java.lang.String ORDER_DISCOUNT_TYPE
          Defines the order discount type
 
Method Summary
 boolean equals(java.lang.Object obj)
          Tests if two discounts are the same
 int getAllowedUses()
          Gets the value of the 'number of uses allowed' parameter for this discount.
 java.lang.String getDescription()
          Gets this discount's description
 java.util.Date getEndDate()
          Gets the discount definition's expiration date
 java.lang.String getGlobalDescription()
          Gets this discount's global description
 QualificationDiscountId getId()
          Get the QualificationDiscountId (unique identifier) associated with this definition
 DiscountModifier getModifier()
          Gets the DiscountModifier associated with this discount
 java.lang.String getName()
          Gets this discounts name, discount names are only unique within a given discount set
 int getPriority()
          Gets the priority associated with this definition
 DiscountRule getRule()
          Gets the DiscountRule associated with this discount
 java.lang.String getSetName()
          Deprecated. As of version 4.0, this method now throws an UnsupportedOperationException.
 java.util.Date getStartDate()
          Gets the discount definition's begin date
 java.lang.String getType()
          Gets the type of this discount, should be one of the discount type constants defined by this interface
 int hashCode()
          A unique code for this discount
 boolean isActive()
          Gets this discount's active flag
 boolean isGlobal()
          Gets this discount's global flag
 void setId(QualificationDiscountId newId)
           
 java.lang.String toString()
          Gets a String representation of this discount
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

ITEM_DISCOUNT_TYPE

public static final java.lang.String ITEM_DISCOUNT_TYPE
Defines the item discount type

ORDER_DISCOUNT_TYPE

public static final java.lang.String ORDER_DISCOUNT_TYPE
Defines the order discount type
Method Detail

getId

public QualificationDiscountId getId()
Get the QualificationDiscountId (unique identifier) associated with this definition

Returns:
this discounts id (QualificationDiscountId)

setId

public void setId(QualificationDiscountId newId)


getPriority

public int getPriority()
Gets the priority associated with this definition

Returns:
this discount's priority

isGlobal

public boolean isGlobal()
Gets this discount's global flag

Returns:
ture if this is a global discount, flase otherwise

getName

public java.lang.String getName()
Gets this discounts name, discount names are only unique within a given discount set

Returns:
this discount's name
See Also:
getSetName()

getType

public java.lang.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

getAllowedUses

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

getModifier

public DiscountModifier getModifier()
Gets the DiscountModifier associated with this discount

Returns:
the DiscountModifier associated with this discount
See Also:
DiscountModifier

getRule

public DiscountRule getRule()
Gets the DiscountRule associated with this discount

Returns:
the DiscountRule associated with this discount
See Also:
DiscountRule

getEndDate

public java.util.Date getEndDate()
Gets the discount definition's expiration date

Returns:
a Date, the discount's expiration date

getStartDate

public java.util.Date getStartDate()
Gets the discount definition's begin date

Returns:
a Date, the discount's begin date

isActive

public boolean isActive()
Gets this discount's active flag

Returns:
true if the discount is active, false otherwise

getDescription

public java.lang.String getDescription()
Gets this discount's description

Returns:
this discount's description

getGlobalDescription

public java.lang.String getGlobalDescription()
Gets this discount's global description

Returns:
this discount's global description

getSetName

public java.lang.String getSetName()
Deprecated. As of version 4.0, this method now throws an UnsupportedOperationException.
Gets the name of the discount set this discount was defined in

Returns:
this discount's set name
Throws:
java.lang.UnsupportedOperationException -  

equals

public boolean equals(java.lang.Object obj)
Tests if two discounts are the same

Parameters:
obj - the QualificationDiscountDef to compare this one against
Returns:
true if the passed QualificationDiscountDef is the same as this one
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
A unique code for this discount

Returns:
the hashCode for this discount
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Gets a String representation of this discount

Returns:
a String representation of this discount
Overrides:
toString in class java.lang.Object

© 2002 BEA Systems, Inc.

Copyright © 2002 BEA Systems, Inc. All Rights Reserved