feedItemFunction.setLhsOperand(new FunctionArgumentOperand[] {requestContextOperand});
feedItemFunction.setOperator(FunctionOperator.IN);
List<FunctionArgumentOperand> operands = new ArrayList<FunctionArgumentOperand>();
for (long feedItemId : siteLinksData.siteLinkFeedItemIds) {
ConstantOperand constantOperand = new ConstantOperand();
constantOperand.setLongValue(feedItemId);
constantOperand.setType(ConstantOperandConstantType.LONG);
operands.add(constantOperand);
}
feedItemFunction.setRhsOperand(operands.toArray(new FunctionArgumentOperand[operands.size()]));
// Optional: to target to a platform, define a function and 'AND' it with
// the feed item ID link:
RequestContextOperand platformRequestContextOperand = new RequestContextOperand();
platformRequestContextOperand.setContextType(RequestContextOperandContextType.DEVICE_PLATFORM);
ConstantOperand platformOperand = new ConstantOperand();
platformOperand.setStringValue("Mobile");
platformOperand.setType(ConstantOperandConstantType.STRING);
Function platformFunction = new Function();
platformFunction.setLhsOperand(new FunctionArgumentOperand[] {platformRequestContextOperand});
platformFunction.setOperator(FunctionOperator.EQUALS);
platformFunction.setRhsOperand(new FunctionArgumentOperand[] {platformOperand});