下面列出了java.util.Collections#emptyList ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
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;
}
@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);
}
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;
}
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");
}
}
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);
}
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");
}
@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);
}
@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();
}
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);
}
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());
}
}
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();
}
}
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;
}
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();
}
public Metric(MetricId<T> id, Integer dataRetention) {
this(id, Collections.emptyMap(), dataRetention, Collections.emptyList());
}
@Override
public List<String> getPreferredTransporters(){
return Collections.emptyList();
}
public ErrorMessage(String resourceBundle, ErrorCode errorCode, Object... params) {
this(Collections.emptyList(), resourceBundle, errorCode, params);
}
public Collection<ChildElementAssumption> getChildElementAssumptions() {
return Collections.emptyList();
}
@Override
public List<List<Scan>> getScans() {
return Collections.emptyList();
}
@Override
public List<ConnectionRecord> getHistory() throws GuacamoleException {
return Collections.<ConnectionRecord>emptyList();
}