public class LineItemCharge extends AbstractCharge
Money or Percentage) that can only be set
during creation.
It either applies per unit or per line as specified within constructor. In case it applies per unit the maximum
number of units to apply to is being specified via setApplicableUnits(int).
Also the charge can be marked to be ignored (see AbstractCharge.setDisabled(boolean)).AbstractCharge.ChargeType| Constructor and Description |
|---|
LineItemCharge(AbstractAmount amount)
Creates a new line item charge with a given amount.
|
LineItemCharge(AbstractAmount amount,
boolean perUnit)
Creates a new line item charge with a specified amount.
|
LineItemCharge(AbstractAmount amount,
boolean perUnit,
int applicableForUnits)
Creates a new line item charge with a specified amount.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getApplicableUnits()
In case this charge applies per unit this method returns the maximum number of units to apply to.
|
boolean |
isPerUnit()
Tells whether this charge applies to each unit of the line item or just once per line.
|
void |
setApplicableUnits(int numberOfUnits)
For the case this charge applies per unit this method changes the maximum number of units to apply to.
|
java.lang.String |
toString() |
getAmount, getChargeType, isDisabled, setChargeType, setDisabledpublic LineItemCharge(AbstractAmount amount)
public LineItemCharge(AbstractAmount amount, boolean perUnit)
amount - the charge amountperUnit - if true the charge is being applied for each unit of the line item, otherwise just once per
linepublic LineItemCharge(AbstractAmount amount, boolean perUnit, int applicableForUnits)
amount - the charge amountperUnit - if true the charge is being applied for each unit of the line item, otherwise just once per
lineapplicableForUnits - if applying per unit this limits the number of units that this charge must be applied topublic boolean isPerUnit()
getApplicableUnits().getApplicableUnits()public int getApplicableUnits()
isPerUnit(),
setApplicableUnits(int)public void setApplicableUnits(int numberOfUnits)
isPerUnit(),
getApplicableUnits()public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2018 SAP SE. All Rights Reserved.