# com.bea.commerce.ebusiness.price.quote
LineItem Class

public class LineItem
extends `Object`
implements `Serializable`

The LineItem class represents some quantity of a ProductItem. The class obtains the base and msrp prices from the ProductItem. LineAdjustment objects may be added to the LineItem to adjust the unit price of some sub-quantity of the LineItem. Each LineAdjustment will have a single detail describing the adjustment.

Related Topics

``Quote``
``ProductItem``
``LineAdjustment``
``OrderAdjustment``
``AdjustmentDetail``
``AdjustmentType``
``QuoteFactory``
``Money``

Hierarchy
  `Object`
  `LineItem`

All Implemented Interfaces
  `Serializable`

## Constructor Summary

LineItem() Constructs a new empty LineItem.
LineItem(`Quote` quote, `ProductItem` product, int qty) Constructs a new LineItem for the Quote specified and representing a quantity of the ProductItem specified.

## Method Summary

`protected void` | `addAdjustment`(int qty, `AdjustmentDetail` detail) Add a LineAdjustment to the LineItem with the specified AdjustmentDetail.
`protected void` | `addAdjustment`(int seqNumber, int qty, `AdjustmentDetail` detail) Add a LineAdjustment to the LineItem with the specified AdjustmentDetail.
`public `List`` | `getAdjustments`() Returns the List of LineAdjustments for this LineItem.
`public final `Money`` | `getBasePrice`() Returns the base unit price for this item.
`public final `String`` | `getCurrency`() Returns the currency for this adjustment.
`public final `Money`` | `getMsrp`() Returns the manufacturers suggested retail price unit price for this item.
`public final `ProductItem`` | `getProductItem`() Returns the ProductItem associated with this LineItem.
`public final int` | `getQty`() Returns the quantity of the ProductItem represented by this LineItem.
`public final `Quote`` | `getQuote`() returns the Quote object for this LineItem
`public `Money`` | `getTotal`() Returns the total price for this LineItem.
`public final long` | `getUID`() returns the unique numeric identifier for the LineItem.
`protected static void` | `resetSeqNumber`() reset sequence number
`public void` | `set`(`Quote` quote, `ProductItem` product, int qty) Initializes the LineItem for the Quote specified and representing a quantity of the ProductItem specified.
`public `String`` | `toString`() Provides a string representation for this LineItem.
`public static final `String`` | `toString`(`List` list) Provides a string representation for a List of LineItems.

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

## Constructor Detail

### LineItem

    protected LineItem()

  Constructs a new empty LineItem. The new LineItem will not represent a ProductItem and will have a quantity of zero and base and msrp prices of zero. To be used this LineItem must be set with the set() method.

### LineItem

    public LineItem(Quote quote,
                    ProductItem product,
                    int qty)

  Constructs a new LineItem for the Quote specified and representing a quantity of the ProductItem specified.

Related Topics

``ProductItem``

## Method Detail

### addAdjustment(int, AdjustmentDetail) Method

    protected void addAdjustment(int qty,
                                 AdjustmentDetail detail)
         throws QuoteException

Add a LineAdjustment to the LineItem with the specified AdjustmentDetail. The sequence number is obtained through the quote object.

#### Parameters

qty
  the quantity of the item to adjust.

detail
  an AdjustmentDetail.

#### Returns

void

#### Exceptions

``QuoteException``

Related Topics

``LineAdjustment``
``AdjustmentDetail``
``Quote``

### addAdjustment(int, int, AdjustmentDetail) Method

    protected void addAdjustment(int seqNumber,
                                 int qty,
                                 AdjustmentDetail detail)
         throws QuoteException

Add a LineAdjustment to the LineItem with the specified AdjustmentDetail. The sequence number is obtained through the quote object.

#### Parameters

seqNumber
  the sequence number for this adjustment.

qty
  the quantity of the item to adjust.

detail
  an AdjustmentDetail.

#### Returns

void

#### Exceptions

``QuoteException``

Related Topics

``LineAdjustment``
``AdjustmentDetail``
``Quote``

### getAdjustments() Method

    public List getAdjustments()

Returns the List of LineAdjustments for this LineItem.

#### Returns

List of LineAdjustments.

Related Topics

``LineAdjustment``

### getBasePrice() Method

    public final Money getBasePrice()

Returns the base unit price for this item.

#### Returns

Money object representing the base unit price for this item.

Related Topics

``Money``
``ProductItem``

### getCurrency() Method

    public final String getCurrency()

Returns the currency for this adjustment. All money values for this adjustment are of this currency

### getMsrp() Method

    public final Money getMsrp()

Returns the manufacturers suggested retail price unit price for this item.

#### Returns

Money object representing the manufacturers suggested retail price unit price for this item.

Related Topics

``Money``
``ProductItem``

### getProductItem() Method

    public final ProductItem getProductItem()

Returns the ProductItem associated with this LineItem.

#### Returns

return the ProductItem for this LineItem, if the no argument constructor was used and the set() method was not called this method will return null.

Related Topics

``ProductItem``

### getQty() Method

    public final int getQty()

Returns the quantity of the ProductItem represented by this LineItem.

### getQuote() Method

    public final Quote getQuote()

returns the Quote object for this LineItem

#### Returns

the Quote object for this LineItem

Related Topics

``Quote``

### getTotal() Method

    public Money getTotal()

Returns the total price for this LineItem. The total is computed by adding the unit prices for each quantity of the LineItem.

#### Returns

Money object representing the total price of the LineItem.

Related Topics

``Money``

### getUID() Method

    public final long getUID()

returns the unique numeric identifier for the LineItem. When LineItems are generated through the QuoteFactory the idnetifiers are guarnteed to be unique.

### resetSeqNumber() Method

    protected static void resetSeqNumber()

reset sequence number

### set(Quote, ProductItem, int) Method

    public void set(Quote quote,
                    ProductItem product,
                    int qty)
         throws QuoteException

Initializes the LineItem for the Quote specified and representing a quantity of the ProductItem specified.

#### Parameters

quote
  the Quote object this LineItem is part of.

product
  the ProductItem associated with this LineItem.

qty
  the quantity of the ProductItem represented by this LineItem.

#### Exceptions

``QuoteException``

Related Topics

``ProductItem``

### toString() Method

    public String toString()

Provides a string representation for this LineItem. This method is intended to for debugging and may change at any time.

Overrides
  `Object.toString()`

### toString(List) Method

    public static final String toString(List list)

Provides a string representation for a List of LineItems. This method is intended to for debugging and may change at any time.