1010import java .util .List ;
1111import java .util .Map ;
1212
13- public class BreinRecommendation extends BreinBase <BreinRecommendation > implements
14- IExecutable <BreinRecommendationResult > {
13+ public class BreinRecommendation extends BreinBase <BreinRecommendation >
14+ implements IExecutable <BreinRecommendationResult > {
1515
1616 /**
1717 * Recommends a user items that are similar to what they previously interacted with
@@ -33,6 +33,10 @@ public class BreinRecommendation extends BreinBase<BreinRecommendation> implemen
3333 * Recommends items that have historically trended during similar times
3434 */
3535 public static final String SUB_RECOMMENDER_TEMPORAL = "temporal" ;
36+ /**
37+ * Recommends items that have are ordered through some config-defined manner
38+ */
39+ public static final String SUB_RECOMMENDER_CUSTOM_SORT = "customSort" ;
3640
3741 /**
3842 * contains the number of recommendations - default is 3
@@ -94,6 +98,11 @@ public class BreinRecommendation extends BreinBase<BreinRecommendation> implemen
9498 */
9599 private Double minQuantity = null ;
96100
101+ /**
102+ * Additional parameters to be passed into the sub recommenders
103+ */
104+ private Map <String , Object > recommendationAdditionalParameters ;
105+
97106 /**
98107 * get the number of recommendations
99108 *
@@ -171,12 +180,12 @@ public List<String> getSubRecommenders() {
171180 return subRecommenders ;
172181 }
173182
174- public BreinRecommendation setMinQuantity (final Double minQuantity ){
183+ public BreinRecommendation setMinQuantity (final Double minQuantity ) {
175184 this .minQuantity = minQuantity ;
176185 return this ;
177186 }
178187
179- public Double getMinQuantity (){
188+ public Double getMinQuantity () {
180189 return minQuantity ;
181190 }
182191
@@ -276,6 +285,16 @@ public BreinRecommendation setBlockers(final List<String> blockers) {
276285 return this ;
277286 }
278287
288+ public Map <String , Object > getRecommendationAdditionalParameters () {
289+ return recommendationAdditionalParameters ;
290+ }
291+
292+ public BreinRecommendation setRecommendationAdditionalParameters (final Map <String , Object >
293+ recommendationAdditionalParameters ) {
294+ this .recommendationAdditionalParameters = recommendationAdditionalParameters ;
295+ return this ;
296+ }
297+
279298 @ Override
280299 public String getEndPoint (final BreinConfig config ) {
281300 return config .getRecommendationEndpoint ();
@@ -308,6 +327,10 @@ public void prepareRequestData(final BreinConfig config, final Map<String, Objec
308327 recommendationData .put ("recommendationSubBlockers" , getBlockers ());
309328 }
310329
330+ if (BreinUtil .containsValue (getRecommendationAdditionalParameters ())) {
331+ recommendationData .put ("recommendationAdditionalParameters" , getRecommendationAdditionalParameters ());
332+ }
333+
311334 if (getRecStartTime () >= 0 ) {
312335 recommendationData .put ("recommendationAtTime" , getRecStartTime ());
313336 }
0 commit comments