java.util.Collections#emptyList ( )源码实例Demo

下面列出了java.util.Collections#emptyList ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: openvsx   文件: VSCodeAdapter.java
private ExtensionQueryResult findExtension(long id, int flags) {
    var extension = entityManager.find(Extension.class, id);
    var resultItem = new ExtensionQueryResult.ResultItem();
    if (extension == null)
        resultItem.extensions = Collections.emptyList();
    else
        resultItem.extensions = Lists.newArrayList(toQueryExtension(extension, flags));

    var countMetadataItem = new ExtensionQueryResult.ResultMetadataItem();
    countMetadataItem.name = "TotalCount";
    countMetadataItem.count = extension == null ? 0 : 1;
    var countMetadata = new ExtensionQueryResult.ResultMetadata();
    countMetadata.metadataType = "ResultCount";
    countMetadata.metadataItems = Lists.newArrayList(countMetadataItem);
    resultItem.resultMetadata = Lists.newArrayList(countMetadata);

    var result = new ExtensionQueryResult();
    result.results = Lists.newArrayList(resultItem);
    return result;
}
 
源代码2 项目: rice   文件: DataDictionaryTypeServiceBase.java
@Override
public List<RemotableAttributeError> validateAttributesAgainstExisting(String kimTypeId, Map<String, String> newAttributes, Map<String, String> oldAttributes){
       if (StringUtils.isBlank(kimTypeId)) {
           throw new RiceIllegalArgumentException("kimTypeId was null or blank");
       }

       if (newAttributes == null) {
           throw new RiceIllegalArgumentException("newAttributes was null or blank");
       }

       if (oldAttributes == null) {
           throw new RiceIllegalArgumentException("oldAttributes was null or blank");
       }
       return Collections.emptyList();
       //final List<RemotableAttributeError> errors = new ArrayList<RemotableAttributeError>();
       //errors.addAll(validateUniqueAttributes(kimTypeId, newAttributes, oldAttributes));
       //return Collections.unmodifiableList(errors);

}
 
源代码3 项目: development   文件: LandingpageServiceBean.java
public List<VOService> servicesForLandingpage(String marketplaceId,
        String locale) {
    List<VOService> services = null;
    try {
        services = landingpageService.servicesForPublicLandingpage(marketplaceId,
                locale);
    } catch (ObjectNotFoundException onf) {
        services = Collections.emptyList();
    }
    return services;
}
 
源代码4 项目: spring-boot   文件: StoredProcedure2.java
List<Book> findBookByName(String name) {

        SqlParameterSource paramaters = new MapSqlParameterSource()
                .addValue("p_name", name);

        Map out = simpleJdbcCallRefCursor.execute(paramaters);

        if (out == null) {
            return Collections.emptyList();
        } else {
            return (List) out.get("o_c_book");
        }

    }
 
源代码5 项目: WeBASE-Front   文件: EvidenceSignersData.java
public RemoteCall<TransactionReceipt> newEvidence(String evi, String info, String id, BigInteger v, byte[] r, byte[] s) {
    final Function function = new Function(
            FUNC_NEWEVIDENCE, 
            Arrays.<Type>asList(new org.fisco.bcos.web3j.abi.datatypes.Utf8String(evi), 
            new org.fisco.bcos.web3j.abi.datatypes.Utf8String(info), 
            new org.fisco.bcos.web3j.abi.datatypes.Utf8String(id), 
            new org.fisco.bcos.web3j.abi.datatypes.generated.Uint8(v), 
            new org.fisco.bcos.web3j.abi.datatypes.generated.Bytes32(r), 
            new org.fisco.bcos.web3j.abi.datatypes.generated.Bytes32(s)), 
            Collections.<TypeReference<?>>emptyList());
    return executeRemoteCallTransaction(function);
}
 
源代码6 项目: old-mzmine3   文件: RawDataFilesSelection.java
public List<RawDataFile> getMatchingRawDataFiles() {

    switch (selectionType) {

      case GUI_SELECTED_FILES:
        return MZmineGUI.getSelectedRawDataFiles();
      case ALL_FILES:
        return MZmineCore.getCurrentProject().getRawDataFiles();
      case SPECIFIC_FILES:
        if (specificFiles == null)
          return Collections.emptyList();
        else
          return specificFiles;
      case NAME_PATTERN:
        if (Strings.isNullOrEmpty(namePattern))
          return Collections.emptyList();
        ArrayList<RawDataFile> matchingDataFiles = new ArrayList<RawDataFile>();
        List<RawDataFile> allDataFiles = MZmineCore.getCurrentProject().getRawDataFiles();

        fileCheck: for (RawDataFile file : allDataFiles) {

          final String fileName = file.getName();

          final String regex = TextUtils.createRegexFromWildcards(namePattern);

          if (fileName.matches(regex)) {
            if (matchingDataFiles.contains(file))
              continue;
            matchingDataFiles.add(file);
            continue fileCheck;
          }
        }
        return matchingDataFiles;
      case BATCH_LAST_FILES:
        return Collections.emptyList();
    }

    throw new IllegalStateException("This code should be unreachable");

  }
 
源代码7 项目: Flink-CEPplus   文件: OuterJoinOperatorBaseTest.java
@Test
public void testFullOuterJoinWithEmptyRightInput() throws Exception {
	final List<String> leftInput = Arrays.asList("foo", "bar", "foobar");
	final List<String> rightInput = Collections.emptyList();
	baseOperator.setOuterJoinType(OuterJoinOperatorBase.OuterJoinType.FULL);
	List<String> expected = Arrays.asList("bar,null", "foo,null", "foobar,null");
	testOuterJoin(leftInput, rightInput, expected);
}
 
源代码8 项目: multiapps   文件: ModelParser.java
@SuppressWarnings("unchecked")
protected <E> List<E> getListElement(String key, ListParser<E> builder) {
    Object list = source.get(key);
    if (list != null) {
        return builder.setSource(((List<Object>) list))
                      .parse();
    }
    return Collections.emptyList();
}
 
源代码9 项目: web3sdk   文件: ParallelOk.java
public void transfer(String from, String to, BigInteger num, TransactionSucCallback callback) {
    final Function function =
            new Function(
                    FUNC_TRANSFER,
                    Arrays.<Type>asList(
                            new org.fisco.bcos.web3j.abi.datatypes.Utf8String(from),
                            new org.fisco.bcos.web3j.abi.datatypes.Utf8String(to),
                            new org.fisco.bcos.web3j.abi.datatypes.generated.Uint256(num)),
                    Collections.<TypeReference<?>>emptyList());
    asyncExecuteTransaction(function, callback);
}
 
源代码10 项目: flink   文件: PluginUtils.java
private static PluginManager createPluginManagerFromRootFolder(PluginConfig pluginConfig) {
	if (pluginConfig.getPluginsPath().isPresent()) {
		try {
			Collection<PluginDescriptor> pluginDescriptors =
				new DirectoryBasedPluginFinder(pluginConfig.getPluginsPath().get()).findPlugins();
			return new DefaultPluginManager(pluginDescriptors, pluginConfig.getAlwaysParentFirstPatterns());
		} catch (IOException e) {
			throw new FlinkRuntimeException("Exception when trying to initialize plugin system.", e);
		}
	}
	else {
		return new DefaultPluginManager(Collections.emptyList(), pluginConfig.getAlwaysParentFirstPatterns());
	}
}
 
源代码11 项目: jdk8u_nashorn   文件: ScriptClassInfoCollector.java
ScriptClassInfo getScriptClassInfo() {
    ScriptClassInfo sci = null;
    if (scriptClassName != null) {
        sci = new ScriptClassInfo();
        sci.setName(scriptClassName);
        if (scriptMembers == null) {
            scriptMembers = Collections.emptyList();
        }
        sci.setMembers(scriptMembers);
        sci.setJavaName(javaClassName);
    }
    return sci;
}
 
/** @hide */
@Override
@SuppressWarnings("unchecked")
public @NonNull List<SharedLibraryInfo> getSharedLibrariesAsUser(int flags, int userId) {
    try {
        ParceledListSlice<SharedLibraryInfo> sharedLibs = mPM.getSharedLibraries(
                mContext.getOpPackageName(), flags, userId);
        if (sharedLibs == null) {
            return Collections.emptyList();
        }
        return sharedLibs.getList();
    } catch (RemoteException e) {
        throw e.rethrowFromSystemServer();
    }
}
 
源代码13 项目: incubator-pinot   文件: TimeOnTimeResponseParser.java
public List<Row> parseResponse() {
  if (baselineResponse == null || currentResponse == null) {
    return Collections.emptyList();
  }
  boolean hasGroupByDimensions = false;
  if (groupByDimensions != null && groupByDimensions.size() > 0) {
    hasGroupByDimensions = true;
  }
  boolean hasGroupByTime = false;
  if (aggTimeGranularity != null) {
    hasGroupByTime = true;
  }

  metricFunctions = baselineResponse.getMetricFunctions();
  numMetrics = metricFunctions.size();
  numTimeBuckets = Math.min(currentRanges.size(), baselineRanges.size());
  if (currentRanges.size() != baselineRanges.size()) {
    LOGGER.info("Current and baseline time series have different length, which could be induced by DST.");
  }
  rows = new ArrayList<>();

  if (hasGroupByTime) {
    if (hasGroupByDimensions) { // contributor view
      parseGroupByTimeDimensionResponse();
    } else { // tabular view
      parseGroupByTimeResponse();
    }
  } else {
    if (hasGroupByDimensions) { // heatmap
      parseGroupByDimensionResponse();
    } else {
      throw new UnsupportedOperationException("Response cannot have neither group by time nor group by dimension");
    }
  }
  return rows;
}
 
源代码14 项目: rice   文件: UiDocumentServiceImpl.java
protected List<KimAttributeField> getAttributeDefinitionsForRole(PersonDocumentRole role) {
   	KimTypeService kimTypeService = KimFrameworkServiceLocator.getKimTypeService(KimTypeBo.to(
               role.getKimRoleType()));
   	//it is possible that the the kimTypeService is coming from a remote application
       // and therefore it can't be guarenteed that it is up and working, so using a try/catch to catch this possibility.
       try {
       	if ( kimTypeService != null ) {
       		return kimTypeService.getAttributeDefinitions(role.getKimTypeId());
       	}
       } catch (Exception ex) {
           LOG.warn("Not able to retrieve KimTypeService from remote system for KIM Role Type: " + role.getKimRoleType(), ex);
       }
   	return Collections.emptyList();
}
 
源代码15 项目: hawkular-metrics   文件: Metric.java
public Metric(MetricId<T> id, Integer dataRetention) {
    this(id, Collections.emptyMap(), dataRetention, Collections.emptyList());
}
 
源代码16 项目: elexis-3-core   文件: Message.java
@Override
public List<String> getPreferredTransporters(){
	return Collections.emptyList();
}
 
源代码17 项目: datacollector-api   文件: ErrorMessage.java
public ErrorMessage(String resourceBundle, ErrorCode errorCode, Object... params) {
  this(Collections.emptyList(), resourceBundle, errorCode, params);
}
 
源代码18 项目: camunda-bpm-platform   文件: TransactionTest.java
public Collection<ChildElementAssumption> getChildElementAssumptions() {
  return Collections.emptyList();
}
 
源代码19 项目: phoenix   文件: ListJarsQueryPlan.java
@Override
public List<List<Scan>> getScans() {
    return Collections.emptyList();
}
 
源代码20 项目: guacamole-client   文件: SimpleConnection.java
@Override
public List<ConnectionRecord> getHistory() throws GuacamoleException {
    return Collections.<ConnectionRecord>emptyList();
}