Class LineItemCharge
java.lang.Object
de.hybris.order.calculation.domain.AbstractCharge
de.hybris.order.calculation.domain.LineItemCharge
Defines a line item specific charge having a amount (can be
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)).-
Nested Class Summary
Nested classes/interfaces inherited from class de.hybris.order.calculation.domain.AbstractCharge
AbstractCharge.ChargeType -
Constructor Summary
ConstructorsConstructorDescriptionLineItemCharge(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. -
Method Summary
Modifier and TypeMethodDescriptionintIn case this charge applies per unit this method returns the maximum number of units to apply to.booleanTells whether this charge applies to each unit of the line item or just once per line.voidsetApplicableUnits(int numberOfUnits) For the case this charge applies per unit this method changes the maximum number of units to apply to.toString()Methods inherited from class de.hybris.order.calculation.domain.AbstractCharge
getAmount, getChargeType, isDisabled, setChargeType, setDisabled
-
Constructor Details
-
LineItemCharge
Creates a new line item charge with a given amount. The charge is applied per line. -
LineItemCharge
Creates a new line item charge with a specified amount. It may be either applied per unit or per line.- Parameters:
amount- the charge amountperUnit- iftruethe charge is being applied for each unit of the line item, otherwise just once per line
-
LineItemCharge
Creates a new line item charge with a specified amount. It may be either applied per unit or per line.- Parameters:
amount- the charge amountperUnit- iftruethe 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 to
-
-
Method Details
-
isPerUnit
public boolean isPerUnit()Tells whether this charge applies to each unit of the line item or just once per line. In case it applies per unit the maximum number of units is specified bygetApplicableUnits().- See Also:
-
getApplicableUnits
public int getApplicableUnits()In case this charge applies per unit this method returns the maximum number of units to apply to.- See Also:
-
setApplicableUnits
public void setApplicableUnits(int numberOfUnits) For the case this charge applies per unit this method changes the maximum number of units to apply to.- See Also:
-
toString
-