List of usage examples for java.util Collections emptyList
@SuppressWarnings("unchecked") public static final <T> List<T> emptyList()
From source file:io.cloudslang.lang.compiler.modeller.transformers.WorkerGroupTransformer.java
@Override public TransformModellingResult<WorkerGroupStatement> transform(String rawData, SensitivityLevel sensitivityLevel) { if (StringUtils.isBlank(rawData)) { return new BasicTransformModellingResult<>(null, Collections.emptyList()); }/* ww w .j av a 2 s .co m*/ WorkerGroupStatement workerGroupStatement; Accumulator dependencyAccumulator; String expression; try { dependencyAccumulator = extractFunctionData(rawData); expression = ExpressionUtils.extractExpression(rawData); } catch (IllegalStateException | IndexOutOfBoundsException e) { return new BasicTransformModellingResult<>(null, Collections.singletonList(e)); } if (expression != null) { workerGroupStatement = new WorkerGroupStatement(expression, dependencyAccumulator.getFunctionDependencies(), dependencyAccumulator.getSystemPropertyDependencies()); } else { workerGroupStatement = new WorkerGroupStatement(rawData, null, null); } return new BasicTransformModellingResult<>(workerGroupStatement, Collections.emptyList()); }
From source file:com.cognifide.qa.bb.scope.frame.FramePath.java
/** * Constructs FramePath. * <p> * Initializes list of frames to an empty list. */ public FramePath() { this.frames = Collections.emptyList(); }
From source file:demo.config.diff.ConfigDiffResult.java
public List<ConfigGroupDiff> getGroupsDiffFor(ConfigDiffType type) { List<ConfigGroupDiff> content = this.groups.get(type); if (content == null) { return Collections.emptyList(); }//from w ww .ja va2s. c om return content; }
From source file:com.orange.ngsi.model.ContextElement.java
public List<ContextAttribute> getContextAttributeList() { if (contextAttributeList == null) { return Collections.emptyList(); }//www . j a va 2s. c o m return contextAttributeList; }
From source file:com.enonic.cms.core.search.ElasticSearchIndexedFieldsTranslator.java
public List<ContentIndexedFields> generateContentIndexFieldSet(ContentKey contentKey, Map<String, GetField> fields) { if (fields.isEmpty()) { return Collections.emptyList(); }/*from ww w. j a va 2 s.com*/ final CategoryKey categoryKey = new CategoryKey((String) fields.get(CATEGORY_KEY_FIELDNAME).getValue()); final ContentIndexFieldSet indexFieldSet = new ContentIndexFieldSet(); indexFieldSet.setCategoryKey(categoryKey); indexFieldSet.setKey(contentKey); final String statusFieldName = STATUS_FIELDNAME + INDEX_FIELD_TYPE_SEPARATOR + NUMBER_FIELD_POSTFIX; indexFieldSet.setStatus(getFieldAsInt(fields.get(statusFieldName))); final String ctypeFieldName = CONTENTTYPE_KEY_FIELDNAME + INDEX_FIELD_TYPE_SEPARATOR + NUMBER_FIELD_POSTFIX; indexFieldSet.setContentTypeKey(new ContentTypeKey(getFieldAsInt(fields.get(ctypeFieldName)))); for (final String name : fields.keySet()) { if (skipField(name)) { continue; } if (name.startsWith(CONTENTDATA_PREFIX) && (!name.contains(INDEX_FIELD_TYPE_SEPARATOR))) { final GetField field = fields.get(name); final String value = StringUtils.join(field.getValues(), ','); if (StringUtils.isNotEmpty(value)) { final String customFieldName = StringUtils.substringAfter(name, CONTENTDATA_PREFIX); indexFieldSet.addFieldWithStringValue("data#" + customFieldName, value); } } else if ((!name.startsWith(CONTENTDATA_PREFIX)) && (!name.contains(INDEX_FIELD_TYPE_SEPARATOR))) { addIndexEntityField(indexFieldSet, name, fields); } } return indexFieldSet.getEntitites(); }
From source file:com.gooddata.md.report.ReportDefinitionContentTest.java
@Test public void testToStringFormat() { final ReportDefinitionContent def = new GridReportDefinitionContent( new Grid(Collections.emptyList(), Collections.emptyList(), Collections.emptyList())); assertThat(def.toString(), matchesPattern(GridReportDefinitionContent.class.getSimpleName() + "\\[.*\\]")); }
From source file:com.haulmont.cuba.gui.data.impl.HierarchicalPropertyDatasourceImpl.java
@Override public Collection<K> getChildren(K itemId) { if (hierarchyPropertyName != null) { final Entity item = getItem(itemId); if (item == null) return Collections.emptyList(); List<K> res = new ArrayList<>(); Collection<K> ids = getItemIds(); for (K id : ids) { Entity<K> currentItem = getItem(id); Object parentItem = currentItem.getValue(hierarchyPropertyName); if (parentItem != null && parentItem.equals(item)) res.add(currentItem.getId()); }//from w w w . j a v a 2s.c o m if (StringUtils.isNotBlank(sortPropertyName)) { Collections.sort(res, new Comparator<K>() { @Override public int compare(K o1, K o2) { Entity item1 = getItem(o1); Entity item2 = getItem(o2); Object value1 = item1.getValue(sortPropertyName); Object value2 = item2.getValue(sortPropertyName); if ((value1 instanceof Comparable) && (value2 instanceof Comparable)) return ((Comparable) value1).compareTo(value2); return 0; } }); } return res; } return Collections.emptyList(); }
From source file:hudson.plugins.timestamper.TimestampFormatterTest.java
/** * @return parameterised test data//from w ww . ja va2s. c o m */ @Parameters public static Collection<Object[]> data() { return Arrays.asList(new Object[][] { { Collections.singletonList("system"), "00:00:42 ", "08:00:42 " }, { Collections.singletonList("elapsed"), "00.123 ", "00.123 " }, { Collections.singletonList("none"), "", "" }, { Collections.emptyList(), "00:00:42 ", "08:00:42 " }, { null, "00:00:42 ", "08:00:42 " } }); }
From source file:de.mgd.simplesoundboard.dao.FileSystemSoundResourceDao.java
@Override public List<String> findSoundCategories() { List<File> files = findFilesInStorageDirectoryIfAny(this::isSoundCategory); if (files.isEmpty()) { return Collections.emptyList(); }/* ww w.j a va 2 s. co m*/ files.sort(NameFileComparator.NAME_INSENSITIVE_COMPARATOR); return files.stream().map(File::getName).collect(Collectors.toList()); }
From source file:com.haulmont.cuba.web.gui.data.EnumerationContainer.java
@Override public Collection getContainerPropertyIds() { return Collections.emptyList(); }