Class UsageChargeEntryModelSortService
- java.lang.Object
-
- de.hybris.platform.subscriptionservices.model.impl.UsageChargeEntryModelSortService
-
- All Implemented Interfaces:
ModelSortService<UsageChargeEntryModel>
public class UsageChargeEntryModelSortService extends java.lang.Object implements ModelSortService<UsageChargeEntryModel>
This service provides functionality for sorting collections ofUsageChargeEntryModelinstances. It sorts instances ofTierUsageChargeEntryModelby their "tierStart" attribute (ascending) and adds any instance ofOverageUsageChargeEntryModelto the end of the sorted list.
-
-
Constructor Summary
Constructors Constructor Description UsageChargeEntryModelSortService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intgetIntValue(java.lang.Integer value)protected booleanisLowestTierUsageChargeEntry(TierUsageChargeEntryModel lowestTierUsageChargeEntry, TierUsageChargeEntryModel tierUsageChargeEntry)java.util.List<UsageChargeEntryModel>sort(java.util.Collection<UsageChargeEntryModel> unsorted)Returns a sortedListof the elements in the givenCollection.protected java.util.List<UsageChargeEntryModel>sort(java.util.List<UsageChargeEntryModel> sorted, java.util.Collection<UsageChargeEntryModel> unsorted)
-
-
-
Method Detail
-
sort
@Nullable public java.util.List<UsageChargeEntryModel> sort(@Nullable java.util.Collection<UsageChargeEntryModel> unsorted)
Description copied from interface:ModelSortServiceReturns a sortedListof the elements in the givenCollection.- Specified by:
sortin interfaceModelSortService<UsageChargeEntryModel>- Parameters:
unsorted- a Collection of elements to be sorted- Returns:
- the sorted List of elements
-
sort
protected java.util.List<UsageChargeEntryModel> sort(java.util.List<UsageChargeEntryModel> sorted, java.util.Collection<UsageChargeEntryModel> unsorted)
-
isLowestTierUsageChargeEntry
protected boolean isLowestTierUsageChargeEntry(TierUsageChargeEntryModel lowestTierUsageChargeEntry, TierUsageChargeEntryModel tierUsageChargeEntry)
-
getIntValue
protected int getIntValue(java.lang.Integer value)
-
-