Class DefaultPaymentPriorityStrategy
- java.lang.Object
-
- com.broadleafcommerce.orderoperation.service.payment.DefaultPaymentPriorityStrategy
-
- All Implemented Interfaces:
PaymentPriorityStrategy
public class DefaultPaymentPriorityStrategy extends Object implements PaymentPriorityStrategy
- Author:
- Samarth Dhruva (samarthd)
-
-
Field Summary
Fields Modifier and Type Field Description protected static int
HIGHEST_PRIORITY
protected static int
LOWEST_PRIORITY
-
Constructor Summary
Constructors Constructor Description DefaultPaymentPriorityStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
getRefundPriority(PaymentSummary payment)
List<PaymentSummary>
sortByRefundPriority(List<PaymentSummary> payments)
Sort based on the priority of eachPaymentSummary.getType()
, withfinal payments
being sorted first.
-
-
-
Field Detail
-
HIGHEST_PRIORITY
protected static final int HIGHEST_PRIORITY
- See Also:
- Constant Field Values
-
LOWEST_PRIORITY
protected static final int LOWEST_PRIORITY
- See Also:
- Constant Field Values
-
-
Method Detail
-
sortByRefundPriority
public List<PaymentSummary> sortByRefundPriority(List<PaymentSummary> payments)
Sort based on the priority of eachPaymentSummary.getType()
, withfinal payments
being sorted first.- Specified by:
sortByRefundPriority
in interfacePaymentPriorityStrategy
- Parameters:
payments
- the payments to sort- Returns:
- a new list representing the sorted result
-
getRefundPriority
protected int getRefundPriority(PaymentSummary payment)
-
-