List of usage examples for java.util Collections EMPTY_LIST
List EMPTY_LIST
To view the source code for java.util Collections EMPTY_LIST.
Click Source Link
From source file:de.hybris.platform.integration.cis.payment.impl.DefaultCisOrderDao.java
private List<OrderModel> getFlexibleSearchResult(final FlexibleSearchQuery query) { query.setResultClassList(Collections.singletonList(OrderModel.class)); final SearchResult<OrderModel> res = getFlexibleSearchService().search(query); final List<OrderModel> result = res.getResult(); return result == null ? Collections.EMPTY_LIST : result; }
From source file:gr.omadak.leviathan.asp.objects.GenericClass.java
public List getMemberList(String name) { Object value = members == null ? null : members.get(caseSensitive ? name : name.toUpperCase()); List result;//from w w w . j a v a 2 s .c o m if (value != null) { if (value instanceof List) { result = (List) value; //hope not modified outside } else { result = Collections.singletonList(value); } } else { result = Collections.EMPTY_LIST; } return result; }
From source file:com.redhat.rhn.frontend.action.audit.scap.XccdfSearchAction.java
protected ActionForward doExecute(HttpServletRequest request, ActionMapping mapping, DynaActionForm form) throws MalformedURLException, XmlRpcException, XmlRpcFault { RequestContext context = new RequestContext(request); String searchString = form.getString(SEARCH_STR); String whereToSearch = form.getString(WHERE_TO_SEARCH); DateRangePicker picker = setupDatePicker(form, request); if (!StringUtils.isBlank(searchString)) { picker.processDatePickers(getOptionScanDateSearch(request), false); DataResult results = XccdfSearchHelper.performSearch(searchString, whereToSearch, getPickerDate(request, "start"), getPickerDate(request, "end"), getRuleResultLabel(form), isTestestResultRequested(form), context); request.setAttribute(RequestContext.PAGE_LIST, results != null ? results : Collections.EMPTY_LIST); if (isTestestResultRequested(form) && results != null) { TagHelper.bindElaboratorTo("searchResultsTr", results.getElaborator(), request); }//from w w w . j a va2 s . c om } else { request.setAttribute(RequestContext.PAGE_LIST, Collections.EMPTY_LIST); picker.processDatePickers(false, false); } return mapping.findForward(RhnHelper.DEFAULT_FORWARD); }
From source file:net.aksingh.owmjapis.HourlyForecast.java
HourlyForecast(JSONObject jsonObj) { super(jsonObj); JSONArray forecastArr = (jsonObj != null) ? jsonObj.optJSONArray(this.JSON_FORECAST_LIST) : new JSONArray(); this.forecastList = (forecastArr != null) ? new ArrayList<Forecast>(forecastArr.length()) : Collections.EMPTY_LIST; if (forecastArr != null && this.forecastList != Collections.EMPTY_LIST) { for (int i = 0; i < forecastArr.length(); i++) { JSONObject forecastObj = forecastArr.optJSONObject(i); if (forecastObj != null) { this.forecastList.add(new Forecast(forecastObj)); }/*w w w . ja va2s. com*/ } } }
From source file:fi.smaa.jsmaa.gui.SMAA2GUIFactory.java
@SuppressWarnings("unchecked") protected SMAA2GUIFactory(Window parent, SMAAModel smaaModel, MenuDirector director) { super(parent, smaaModel, director); SMAA2Results emptyResults = new SMAA2Results(Collections.EMPTY_LIST, Collections.EMPTY_LIST, 1); centralWeightsDataset = new CentralWeightsDataset(emptyResults); centralWeightsTM = new CentralWeightTableModel(emptyResults); rankAcceptabilitiesDataset = new RankAcceptabilitiesDataset(emptyResults); rankAcceptabilitiesTM = new RankAcceptabilityTableModel(emptyResults); }
From source file:reconf.server.services.property.ClientReadPropertyServiceTest.java
@Test public void not_found() throws Exception { when(propertyRepository.findByKeyProductAndKeyComponentAndKeyNameOrderByRulePriorityDescKeyRuleNameAsc( PROPERTY_KEY_PRODUCT, PROPERTY_KEY_COMPONENT, PROPERTY_KEY_NAME)) .thenReturn(Collections.EMPTY_LIST); this.mockMvc//from www . ja v a 2 s . c o m .perform(get("/{prod}/{comp}/{prop}", PROPERTY_KEY_PRODUCT, PROPERTY_KEY_COMPONENT, PROPERTY_KEY_NAME).accept(ReConfConstants.MT_PROTOCOL_V1)) .andDo(print()).andExpect(status().isNotFound()); verify(propertyRepository).findByKeyProductAndKeyComponentAndKeyNameOrderByRulePriorityDescKeyRuleNameAsc( PROPERTY_KEY_PRODUCT, PROPERTY_KEY_COMPONENT, PROPERTY_KEY_NAME); }
From source file:net.landora.video.preferences.PreferenceObject.java
private static List<String> convertToStringList(String value) { if (value.isEmpty()) { return Collections.EMPTY_LIST; }// w w w.j ava 2s . c o m List<String> result = new ArrayList<String>(); int lastIndex = -1; int index; while ((index = value.indexOf('\t', lastIndex + 1)) != -1) { result.add(StringEscapeUtils.unescapeJava(value.substring(lastIndex + 1, index))); lastIndex = index; } return result; }
From source file:com.platzerworld.e4.biergarten.model.mock.MockBiergarten.java
@Override public List<Biergarten> getAllCountries() { String url = "http://ws.geonames.org/countryInfo?"; List<Country> jj = (List<Country>) doSearch(url, null, "//geonames/country", new CountryNodeMapper()); return Collections.EMPTY_LIST; }
From source file:be.vlaanderen.sesam.monitor.internal.ConfigurationServiceImpl.java
@SuppressWarnings("unchecked") @Scheduled(fixedDelay = SCANTIMEMILLIS)//from w ww.j a va2s . co m public void checkConfigurationChange() { log.debug("Checking for configuration changes."); try { File f = new File(configurationFile); if (f.isFile()) { long l = f.lastModified(); if (l != lastModified) { loadConfiguration(); } } else { log.warn("Configuration file not found!"); monitorService.monitor(Collections.EMPTY_LIST); } } catch (Exception e) { log.warn("Failed checking for configuration changes: " + e.getMessage()); } }
From source file:org.syncope.core.workflow.activiti.SyncopeGroupManager.java
@Override public List<Group> findGroupsByUser(final String userId) { List<Group> result = Collections.EMPTY_LIST; SyncopeUser user = userDAO.find(userId); if (user != null) { result = new ArrayList<Group>(); for (Long roleId : user.getRoleIds()) { result.add(new GroupEntity(roleId.toString())); }// w w w. j av a 2s .com } return result; }