added required=false for RESPONSE_TYPE in @header annotation

This commit is contained in:
Mark Fisher
2010-10-28 16:47:38 -04:00
parent 2d730d4472
commit 5d1c0933fa

View File

@@ -40,7 +40,7 @@ public class LoanQuoteAggregator {
* @param responseType header that indicates the response type
* @return the best {@link LoanQuote} if the 'RESPONSE_TYPE' header value is 'BEST' else all quotes
*/
public Object aggregateQuotes(List<LoanQuote> quotes, @Header("RESPONSE_TYPE") String responseType) {
public Object aggregateQuotes(List<LoanQuote> quotes, @Header(value="RESPONSE_TYPE", required=false) String responseType) {
Collections.sort(quotes);
return ("BEST".equals(responseType)) ? quotes.get(0) : quotes;
}