# com.bea.commerce.ebusiness.price.service
DiscountPresentation Class

public class DiscountPresentation
extends `Object`
implements `Serializable`

This class is used to hold information corresponding to pricing adjustments to a Line item. A List of DiscountPresentation objects will be attached to a Line item to show adjustments to the price of that Line item.

Related Topics

``PricingReply``
``Line``

Hierarchy
  `Object`
  `DiscountPresentation`

All Implemented Interfaces
  `Serializable`

Direct Known Subclasses
  `OrderAdjustmentPresentation`

## Constructor Summary

DiscountPresentation(double quantity, `Money` unitPrice, `Money` discount, `String` computation, `String` reason) Construct a DiscountPresentation object with the specified values.

## Method Summary

`public `String`` | `getComputation`() Retrieve the computation string associated with this adjustment.
`public `Money`` | `getDiscount`()
`public double` | `getQuantity`() Retrieves the quantity of the Line for which this adjustment applies.
`public `String`` | `getReason`() Retrieve the string describing the reason for the adjustment, For instance: "Spring Sale" or "First time buyer discount".
`public `String`` | `getShortText`()
`public `Money`` | `getUnitPrice`()
`public void` | `set`(double quantity, `Money` unitPrice, `Money` discount, `String` computation, `String` reason) Initialize the DiscountPresentation object with the specified values.
`public void` | `setComputation`(`String` computation) Sets the computation string associated with the computation of this adjustment
`public void` | `setDiscount`(`Money` discount) Sets the actual amount discounted for this quantity of the Line.
`public void` | `setQuantity`(double quantity) Sets the quantity of the Line for which this adjustment applies.
`public void` | `setReason`(`String` reason) Sets the string describing the reason for the adjustment.
`public void` | `setUnitPrice`(`Money` unitPrice) Sets the actual per unit price after adjustment for the Line.
`public `String`` | `toString`() This method is intended for debugging and may be changed at any time.

Methods from class `java.lang.`Object``
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Detail

### DiscountPresentation

    public DiscountPresentation(double quantity,
                                Money unitPrice,
                                Money discount,
                                String computation,
                                String reason)

  Construct a DiscountPresentation object with the specified values.

Related Topics

``Line``
``Money``

## Method Detail

### getComputation() Method

    public String getComputation()

Retrieve the computation string associated with this adjustment. This value will typically be something like: "10% off" or "$5 off".

### getDiscount() Method

    public Money getDiscount()

#### Returns

the amount of the adjustment for this quantity of the Line. More specifically, (<base unit price> * <quantity>) - (<actual unit price> * <quantity>) This value is positive for adjustments that reduce the cost of the Line. Negative otherwise.

### getQuantity() Method

    public double getQuantity()

Retrieves the quantity of the Line for which this adjustment applies.

#### Returns

the quantity to which this adjustment applies.

### getReason() Method

    public String getReason()

Retrieve the string describing the reason for the adjustment, For instance: "Spring Sale" or "First time buyer discount".

### getShortText() Method

    public String getShortText()

#### Returns

a string that includes both the computation and reason in the form of "Discount: <computation> - <reason>".

### getUnitPrice() Method

    public Money getUnitPrice()

#### Returns

the actual per unit price for this quantity of the Line after adjustment.

### set(double, Money, Money, String, String) Method

    public void set(double quantity,
                    Money unitPrice,
                    Money discount,
                    String computation,
                    String reason)

Initialize the DiscountPresentation object with the specified values.

#### Parameters

quantity
  a double value specifying the quantity of the Line item corresponding to this presentation object.

unitPrice
  the discounted unit price for this quantity of the Line.

discount
  the amount of money discounted for this quantity of the Line.

computation
  a string describing the computation that produced the actual unit price from the original unit price.

reason
  a string describing the reason this quantity of the Line was adjusted.

Related Topics

``Line``
``Money``

### setComputation(String) Method

    public void setComputation(String computation)

Sets the computation string associated with the computation of this adjustment

#### Parameters

computation
  a String corresponding to how the actual unit price was derived from the base unit price.

### setDiscount(Money) Method

    public void setDiscount(Money discount)

Sets the actual amount discounted for this quantity of the Line.

#### Parameters

discount
  the amount discounted. More specifically, (<base unit price> * <quantity>) - (<actual unit price> * <quantity>)

### setQuantity(double) Method

    public void setQuantity(double quantity)

Sets the quantity of the Line for which this adjustment applies.

#### Parameters

quantity
  a double value corresponding to the quantity for this adjustment.

### setReason(String) Method

    public void setReason(String reason)

Sets the string describing the reason for the adjustment.

### setUnitPrice(Money) Method

    public void setUnitPrice(Money unitPrice)

Sets the actual per unit price after adjustment for the Line.

#### Parameters

unitPrice
  the new unit price for this quantity of the Line.

### toString() Method

    public String toString()

This method is intended for debugging and may be changed at any time. The method returns a string containing all the values for all fields in this class.

Overrides
  `Object.toString()`