# com.beasys.commerce.ebusiness.order
OrderLineImpl Class

public class OrderLineImpl
extends `BelongingImpl`
implements `OrderLine`

OrderLine represents one line in an Order. It contains a reference to an Item, a Quantity, a unitPrice and a list of Adjustments to the total line price.

Related Topics

``OrderLine``
``OrderLineHome``

Hierarchy
  `Object`
  `BelongingImpl`
  `OrderLineImpl`

All Implemented Interfaces
  `Belonging`, `BusinessSmartComponent`, `Cloneable`, `Comparable`, `OrderLine`, `RelationalReference`, `Serializable`

## Field Summary

`public `ArrayList`` | `adjustmentPresentations` the list of OrderAdjustmentPresentation objects relating to a particular line.
`public `String`` | `description` Containment: By Value Multiplicity: 1:1
`public `Money`` | `msrp` Containment: By Value Multiplicity: 1:1
`public `String`` | `productIdentifier` Containment: By Value Multiplicity: 1:1
`public double` | `quantity` Containment: By Value Multiplicity: 1:1
`public `Money`` | `shipping` Containment: By Value Multiplicity: 1:1
`public `Money`` | `tax` Containment: By Value Multiplicity: 1:1
`public double` | `totalLineAmount` The total for the line
`public `Money`` | `unitPrice` Containment: By Value Multiplicity: 1:1

Fields from com.beasys.commerce.foundation`.`BelongingImpl``
``__classIdentifier`, `__containingBelonging`, `__containingEntity`, `__mapKey`, `__sequenceNumber`, `_isDirty``

## Constructor Summary

OrderLineImpl()

## Method Summary

`public int` | `compareTo`(`Object` o) Compare this belonging to another
`protected void` | `freezeId`() Once this method is called, any calls to setId() will fail.
`public `ArrayList`` | `getAdjustmentPresentations`() Get the list of OrderAdjustmentPresentation objects
`public `String`` | `getDescription`() Get the value of description
`public long` | `getId`() Get order line id.
`public `Money`` | `getLineTotal`(int totalType) Gets the line total for the given total type
`public `Money`` | `getMsrp`() Get the value of Msrp
`public `String`` | `getProductIdentifier`() Get the value of productIdentifier
`public double` | `getQuantity`() Get the value of quantity
`public `Money`` | `getShipping`() Get the value of shipping
`public `Money`` | `getTax`() Get the value of tax
`public double` | `getTotalLineAmount`() Get the value of totalLineAmount
`public `Money`` | `getUnitPrice`() Get the value of unitPrice
`public `String`` | `interfaceName`() interfaceName() returns the unqualified name of the interface from the UML model
`public void` | `setAdjustmentPresentations`(`ArrayList` adjustmentPresentations) Set the list of OrderAdjustmentPresentation object
`public void` | `setByValue`(`Belonging` value) It is possible to call set-by-value with a superclass.
`public void` | `setDescription`(`String` description) Set the value of description
`public void` | `setId`(long id) Set the order line id.
`public void` | `setMsrp`(`Money` msrp) Set the value of Msrp
`public void` | `setProductIdentifier`(`String` productIdentifier) Set the value of productIdentifier
`public void` | `setQuantity`(double quantity) Set the value of quantity
`public void` | `setShipping`(`Money` shipping) Set the value of shipping
`public void` | `setTax`(`Money` tax) Set the value of tax
`public void` | `setTotalLineAmount`(double totalLineAmount) Set the value of subTotalAmount
`public void` | `setUnitPrice`(`Money` unitPrice) Set the value of unitPrice
`public `Belonging`` | `value`() value() is a more typesafe implementation of clone()

Methods from `com.beasys.commerce.foundation.`BelongingImpl``
``clearRelationalBinding`, `clearRelationalBinding`, `clearRelationalBinding`, `clearRelationalBinding`, `clone`, `doRelationalBinding`, `doRelationalBinding`, `doRelationalBindingOnElement`, `doRelationalBindingOnElement`, `doRelationalBindingOnElement`, `doRelationalBindingOnSingleton`, `doRelationalBindingOnSingleton`, `doRelationalBindingOnSingleton`, `doRelationalBindingWithMapKey`, `doRelationalBindingWithMapKey`, `doRelationalBindingWithMapKey`, `enumerateRelationalBinding`, `enumerateRelationalBinding`, `equals`, `get__classIdentifier`, `get__containingBelonging`, `get__containingEntity`, `get__containingEntityReference`, `get__mapKey`, `get__sequenceNumber`, `getPersistenceHelperPlugin`, `hashCode`, `set__classIdentifier`, `set__containingBelonging`, `set__containingEntity`, `set__containingEntityReference`, `set__mapKey`, `toString``

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

Methods from interface `com.beasys.commerce.foundation.`Belonging``
``clone`, `equals`, `interfaceName`, `setByValue`, `value``

Methods from interface `java.lang.`Comparable``
`compareTo`

Methods from interface `com.beasys.commerce.ebusiness.order.`OrderLine``
``getAdjustmentPresentations`, `getDescription`, `getId`, `getLineTotal`, `getMsrp`, `getProductIdentifier`, `getQuantity`, `getShipping`, `getTax`, `getTotalLineAmount`, `getUnitPrice`, `setAdjustmentPresentations`, `setDescription`, `setId`, `setMsrp`, `setProductIdentifier`, `setQuantity`, `setShipping`, `setTax`, `setTotalLineAmount`, `setUnitPrice``

Methods from interface `com.beasys.commerce.foundation.`RelationalReference``
``get__classIdentifier`, `get__containingBelonging`, `get__containingEntity`, `get__mapKey`, `get__sequenceNumber`, `set__containingBelonging`, `set__containingEntity`, `set__mapKey``

## Field Detail

### adjustmentPresentations

    public ArrayList adjustmentPresentations

  the list of OrderAdjustmentPresentation objects relating to a particular line. This will only be filled if OrderAsjustmentPersistence select has been called on the parent order.

### description

    public String description

  - Containment: By Value
  - Multiplicity: 1:1

### msrp

    public Money msrp

  - Containment: By Value
  - Multiplicity: 1:1

### productIdentifier

    public String productIdentifier

  - Containment: By Value
  - Multiplicity: 1:1

### quantity

    public double quantity

  - Containment: By Value
  - Multiplicity: 1:1

### shipping

    public Money shipping

  - Containment: By Value
  - Multiplicity: 1:1

### tax

    public Money tax

  - Containment: By Value
  - Multiplicity: 1:1

### totalLineAmount

    public double totalLineAmount

  The total for the line

### unitPrice

    public Money unitPrice

  - Containment: By Value
  - Multiplicity: 1:1

## Constructor Detail

### OrderLineImpl

    public OrderLineImpl()

## Method Detail

### compareTo(Object) Method

    public int compareTo(Object o)

Compare this belonging to another

Overrides
  `BelongingImpl.compareTo(Object)`

#### Parameters

o
  target object for comparision

#### Returns

0 objects are equal

### freezeId() Method

    protected void freezeId()

Once this method is called, any calls to setId() will fail. This causes id to be frozen after this OrderLine is first persisted in the database. It must be this way since the id is this OrderLine's primary key. This method is called by the WLCS internals.

### getAdjustmentPresentations() Method

    public ArrayList getAdjustmentPresentations()

Get the list of OrderAdjustmentPresentation objects

#### Returns

an array list

### getDescription() Method

    public String getDescription()

Get the value of description

#### Returns

description.

### getId() Method

    public long getId()

Get order line id. This id matches the primary key in the database.

#### Returns

an array list

### getLineTotal(int) Method

    public Money getLineTotal(int totalType)
         throws InvalidArgumentException

Gets the line total for the given total type

#### Parameters

totalType
  type

#### Exceptions

``InvalidArgumentException``

### getMsrp() Method

    public Money getMsrp()

Get the value of Msrp

#### Returns

Msrp.

### getProductIdentifier() Method

    public String getProductIdentifier()

Get the value of productIdentifier

#### Returns

productIdentifier.

### getQuantity() Method

    public double getQuantity()

Get the value of quantity

#### Returns

quantity.

### getShipping() Method

    public Money getShipping()

Get the value of shipping

#### Returns

shipping.

### getTax() Method

    public Money getTax()

Get the value of tax

#### Returns

tax.

### getTotalLineAmount() Method

    public double getTotalLineAmount()

Get the value of totalLineAmount

#### Returns

totalLineAmount.

### getUnitPrice() Method

    public Money getUnitPrice()

Get the value of unitPrice

#### Returns

unitPrice.

### interfaceName() Method

    public String interfaceName()

interfaceName() returns the unqualified name of the interface from the UML model

#### Returns

the unqualified name of the belonging interface from the UML model

### setAdjustmentPresentations(ArrayList) Method

    public void setAdjustmentPresentations(ArrayList adjustmentPresentations)

Set the list of OrderAdjustmentPresentation object

#### Parameters

adjustmentPresentations
  the list of OrderDiscountPresentations

### setByValue(Belonging) Method

    public void setByValue(Belonging value)

It is possible to call set-by-value with a superclass. If that is the case, only the fields in the superclass will be set in this instance. The remaining fields get the default values.

It is also possible to call set-by-value with a subclass. In this case, the specialized fields in the subclass will be ignored. The overridden fields in the subclass will be populated.

Overrides
  `BelongingImpl.setByValue(Belonging)`

#### Parameters

value
  The `Belonging` to use for initialization.

### setDescription(String) Method

    public void setDescription(String description)

Set the value of description

#### Parameters

description
  description to be added

### setId(long) Method

    public void setId(long id)

Set the order line id. This id is the primary key for this OrderLine in the database. Because of this, all calls to setId AFTER the OrderLine is first persisted will fail. A debug message will be sent to the log in in this case.

#### Parameters

id
  the long order line id.

### setMsrp(Money) Method

    public void setMsrp(Money msrp)

Set the value of Msrp

#### Parameters

msrp
  Msrp to be added

### setProductIdentifier(String) Method

    public void setProductIdentifier(String productIdentifier)

Set the value of productIdentifier

#### Parameters

productIdentifier
  productIdentifier to be added

### setQuantity(double) Method

    public void setQuantity(double quantity)

Set the value of quantity

#### Parameters

quantity
  quantity to be added

### setShipping(Money) Method

    public void setShipping(Money shipping)

Set the value of shipping

#### Parameters

shipping
  shipping to be added

### setTax(Money) Method

    public void setTax(Money tax)

Set the value of tax

#### Parameters

tax
  tax to be added

### setTotalLineAmount(double) Method

    public void setTotalLineAmount(double totalLineAmount)

Set the value of subTotalAmount

#### Parameters

totalLineAmount
  subTotalAmount to be added

### setUnitPrice(Money) Method

    public void setUnitPrice(Money unitPrice)

Set the value of unitPrice

#### Parameters

unitPrice
  unitPrice to be added

### value() Method

    public Belonging value()

value() is a more typesafe implementation of clone()

#### Returns

a clone of this instance