Java Code Examples for java.util.Collections#emptyList()

The following examples show how to use java.util.Collections#emptyList() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: VSCodeAdapter.java    From openvsx with Eclipse Public License 2.0 6 votes vote down vote up
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;
}
 
Example 2
Source File: DataDictionaryTypeServiceBase.java    From rice with Educational Community License v2.0 6 votes vote down vote up
@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);

}
 
Example 3
Source File: LandingpageServiceBean.java    From development with Apache License 2.0 5 votes vote down vote up
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;
}
 
Example 4
Source File: UiDocumentServiceImpl.java    From rice with Educational Community License v2.0 5 votes vote down vote up
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();
}
 
Example 5
Source File: StoredProcedure2.java    From spring-boot with MIT License 5 votes vote down vote up
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");
        }

    }
 
Example 6
Source File: EvidenceSignersData.java    From WeBASE-Front with Apache License 2.0 5 votes vote down vote up
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);
}
 
Example 7
Source File: RawDataFilesSelection.java    From old-mzmine3 with GNU General Public License v2.0 5 votes vote down vote up
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");

  }
 
Example 8
Source File: OuterJoinOperatorBaseTest.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example 9
Source File: TimeOnTimeResponseParser.java    From incubator-pinot with Apache License 2.0 5 votes vote down vote up
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;
}
 
Example 10
Source File: ModelParser.java    From multiapps with Apache License 2.0 5 votes vote down vote up
@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();
}
 
Example 11
Source File: ParallelOk.java    From web3sdk with Apache License 2.0 5 votes vote down vote up
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);
}
 
Example 12
Source File: ApplicationPackageManager.java    From AndroidComponentPlugin with Apache License 2.0 5 votes vote down vote up
/** @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();
    }
}
 
Example 13
Source File: PluginUtils.java    From flink with Apache License 2.0 5 votes vote down vote up
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());
	}
}
 
Example 14
Source File: ScriptClassInfoCollector.java    From jdk8u_nashorn with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example 15
Source File: SimpleConnection.java    From guacamole-client with Apache License 2.0 4 votes vote down vote up
@Override
public List<ConnectionRecord> getHistory() throws GuacamoleException {
    return Collections.<ConnectionRecord>emptyList();
}
 
Example 16
Source File: ListJarsQueryPlan.java    From phoenix with Apache License 2.0 4 votes vote down vote up
@Override
public List<List<Scan>> getScans() {
    return Collections.emptyList();
}
 
Example 17
Source File: TransactionTest.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
public Collection<ChildElementAssumption> getChildElementAssumptions() {
  return Collections.emptyList();
}
 
Example 18
Source File: ErrorMessage.java    From datacollector-api with Apache License 2.0 4 votes vote down vote up
public ErrorMessage(String resourceBundle, ErrorCode errorCode, Object... params) {
  this(Collections.emptyList(), resourceBundle, errorCode, params);
}
 
Example 19
Source File: Message.java    From elexis-3-core with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public List<String> getPreferredTransporters(){
	return Collections.emptyList();
}
 
Example 20
Source File: Metric.java    From hawkular-metrics with Apache License 2.0 4 votes vote down vote up
public Metric(MetricId<T> id, Integer dataRetention) {
    this(id, Collections.emptyMap(), dataRetention, Collections.emptyList());
}