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:info.magnolia.cms.taglibs.ContentNodeIterator.java
/** * @param request//from w w w . j a v a 2 s . co m * @return * @throws PathNotFoundException * @throws RepositoryException * @throws AccessDeniedException */ private Collection getCollection(HttpServletRequest request) throws PathNotFoundException, RepositoryException, AccessDeniedException { if (this.items != null) { return this.items; } else if (StringUtils.isNotEmpty(this.contentNodeCollectionName)) { Content page = Resource.getCurrentActivePage(request); return page.getContent(this.contentNodeCollectionName).getChildren(ItemType.CONTENTNODE); } return Collections.EMPTY_LIST; }
From source file:com.tuplejump.stargate.cassandra.SearchSupport.java
@Override public List<Row> search(ExtendedFilter mainFilter) { List<IndexExpression> clause = mainFilter.getClause(); if (logger.isDebugEnabled()) logger.debug("All IndexExprs {}", clause); try {//from w w w . j a v a 2 s.c o m String queryString = getQueryString(matchThisIndex(clause)); Search search = getQuery(queryString); return getRows(mainFilter, search, queryString); } catch (Exception e) { logger.error("Exception occurred while querying", e); if (tableMapper.isMetaColumn) { ByteBuffer errorMsg = UTF8Type.instance .decompose("{\"error\":\"" + StringEscapeUtils.escapeEcmaScript(e.getMessage()) + "\"}"); Row row = tableMapper.getRowWithMetaColumn(errorMsg); if (row != null) { return Collections.singletonList(row); } } return Collections.EMPTY_LIST; } }
From source file:se.vgregion.urlservice.repository.jpa.JpaBookmarkRepositoryTest.java
@Test(expected = PersistenceException.class) @Transactional/*from ww w . java 2 s . co m*/ @Rollback public void duplicateHashNotAllowed() { try { dao.persist(new Bookmark(bookmark1.getHash(), longUrl, Collections.EMPTY_LIST, owner)); dao.flush(); } catch (PersistenceException e) { e.printStackTrace(); throw e; } }
From source file:hydrograph.ui.graph.execution.tracking.connection.HydrographServerConnection.java
/** * Gets the kill req./*from w w w. j a v a 2s. co m*/ * * @param jobID the job id * @return the kill req */ private String getKillReq(String jobID) { ExecutionStatus executionStatus = new ExecutionStatus(Collections.EMPTY_LIST); executionStatus.setJobId(jobID); executionStatus.setType("kill"); executionStatus.setClientId("ui-client"); Gson gson = new Gson(); return gson.toJson(executionStatus); }
From source file:com.streamsets.pipeline.stage.processor.xmlflattener.TestXMLFlatteningProcessor.java
@Test public void testSingleRecordNoAttrsNoNS() throws Exception { String xml = getXML(""); Record expected = RecordCreator.create(); expected.set(Field.create(createExpectedRecord("", "", "", ".", "#", "", false, false))); doTest(xml, "contact", ImmutableList.of(expected), Collections.EMPTY_LIST, OnRecordError.DISCARD, true, true, false, false);//w w w . java 2 s.c o m }
From source file:com.sun.faces.context.FacesContextImpl.java
public Iterator getClientIdsWithMessages() { assertNotReleased();/* ww w . j a v a 2s .c om*/ Iterator result = null; if (null == componentMessageLists) { result = Collections.EMPTY_LIST.iterator(); } else { result = componentMessageLists.keySet().iterator(); } return result; }
From source file:com.qcadoo.mes.productionPerShift.DateTimeRange.java
public Collection<? extends DateTimeRange> remove(final DateTimeRange range) { Interval other = range.interval;/* w w w . ja va 2 s .com*/ if (interval.contains(other)) { return Lists.newArrayList(new DateTimeRange(interval.getStart(), other.getStart()), new DateTimeRange(other.getEnd(), interval.getEnd())); } else if (other.contains(interval)) { return Collections.EMPTY_LIST; } else if (interval.overlaps(other)) { if (interval.getStart().isBefore(other.getStart())) { return Lists.newArrayList(new DateTimeRange(interval.getStart(), other.getStart())); } else { return Lists.newArrayList(new DateTimeRange(other.getEnd(), interval.getEnd())); } } return Lists.newArrayList(this); }
From source file:de.micromata.genome.chronos.spi.ram.RamJobStore.java
@Override @SuppressWarnings("unchecked") public synchronized List<TriggerJobDO> getJobs(Scheduler scheduler, Date fromDate, Date untilDate, State state) {//from w w w. j a v a 2 s.c om final Map<Long, TriggerJobDO> tjobs; if (scheduler != null) { tjobs = allJobs.get(scheduler.getId()); } else { tjobs = new HashMap<>(); for (Map<Long, TriggerJobDO> scheds : allJobs.values()) { synchronized (scheds) { tjobs.putAll(scheds); } } } if (tjobs == null) { return Collections.EMPTY_LIST; } List<TriggerJobDO> ret = new ArrayList<TriggerJobDO>(); ret.addAll(tjobs.values()); for (Iterator<TriggerJobDO> it = ret.iterator(); it.hasNext() == true;) { TriggerJobDO job = it.next(); if (state != null) { if (job.getState() != state) { it.remove(); continue; } } if (fromDate != null) { if (job.getModifiedAt() != null && job.getModifiedAt().after(fromDate) == true) { it.remove(); continue; } } if (untilDate != null) { if (job.getModifiedAt() != null && job.getModifiedAt().before(untilDate) == true) { it.remove(); continue; } } } return ret; // TODO genome chronos filter }
From source file:de.hybris.platform.mpintgproductcockpit.editorAera.TmallAttributeSection.java
@Override public List<EditorSectionConfiguration> getAdditionalSections() { return Collections.EMPTY_LIST; }
From source file:it.geosolutions.geobatch.unredd.script.util.GeoStoreUtil.java
/** * Generic search in GeoStoreUtil./*from w w w . j a v a 2 s . c o m*/ * * @param filter the filter to apply for searching * @param getShortResource true if a list of resource is required, false if a RESTResource list is sufficient * * @return always a not null list */ // @Override protected List search(SearchFilter filter, boolean getShortResource, String fileNameHint) throws GeoStoreException { File tmpFile = null; try { tmpFile = File.createTempFile(fileNameHint, ".xml", tempDir); Marshaller m = JAXBMarshallerBuilder.getJAXBMarshaller(filter.getClass()); m.marshal(filter, tmpFile); GeostoreActionConfiguration geoStoreCfg = createConfiguration(); geoStoreCfg.setShortResource(getShortResource); geoStoreCfg.setOperation(GeostoreOperation.Operation.SEARCH); GeostoreAction action = new GeostoreAction(geoStoreCfg); action.setTempDir(tempDir); SingleFileActionExecutor.execute(action, tmpFile); List ret = getShortResource ? action.getShortResourceList() : action.getResourceList(); return ret == null ? Collections.EMPTY_LIST : ret; } catch (Exception e) { throw new GeoStoreException("Error while searching in GeoStore", e); } finally { FileUtils.deleteQuietly(tmpFile); // we're putting the temp file in a working dir, so this delete is probably useless } }