public static RedirectCondition createRedirectCondition(String name) { RedirectCondition redirectCondition = new RedirectCondition(); redirectCondition.setName(name); redirectCondition.setDeviceProperties(null); redirectCondition.setUserAgentConditions(null); return redirectCondition; }
public static PortalRedirect createSimpleDevicePropertiesRedirect( DevicePropertyCondition... devicePropertyConditions) { PortalRedirect portalRedirect = createSimpleRedirect(); RedirectCondition redirectCondition = createRedirectCondition("conditionA"); String[] contains = {".*"}; redirectCondition.setUserAgentConditions(createUserAgentConditionContains(contains, null)); ArrayList<DevicePropertyCondition> devicePropertyConditionsList = null; if (devicePropertyConditions != null) { devicePropertyConditionsList = new ArrayList<DevicePropertyCondition>(); for (DevicePropertyCondition deviceProperty : devicePropertyConditions) { devicePropertyConditionsList.add(deviceProperty); } } redirectCondition.setDeviceProperties(devicePropertyConditionsList); ArrayList<RedirectCondition> conditions = createRedirectConditions(redirectCondition); portalRedirect.setConditions(conditions); return portalRedirect; }