@CompileStatic class PercentBasedMaxAllowedWeightPerContainerPolicy extends Object implements MaxAllowedWeightPerContainerPolicy
MaxAllowedWeightPerContainerPolicy implementation that calculates the allowed weight based on percentage of absolute maximum weight allowed by container type.
For example, if ContainerType allows for maximum weight of25_000
kilograms, this policy implementation for 90%
will reduce it further to 22_500
kilograms.
Type | Name and description |
---|---|
Integer |
percentOfContainerTypeMaxCommodityWeight |
RoundingMode |
roundingMode |
Unit<Mass> |
targetUnitOfMass |
Constructor and description |
---|
PercentBasedMaxAllowedWeightPerContainerPolicy(Integer percentOfContainerTypeMaxCommodityWeight, Unit<Mass> targetUnitOfMass, RoundingMode roundingMode) Constructor. |
Type Params | Return Type | Name and description |
---|---|---|
|
Quantity<Mass> |
maxAllowedWeightPerContainer(ContainerType containerType) |
Constructor.
Default params values:targetUnitOfMass
: Units.KILOGRAM
roundingMode
: RoundingMode.DOWN
null
.percentOfContainerTypeMaxCommodityWeight
must be between 1
and 100
inclusive.
Groovy Documentation