当前位置: 首页>>代码示例>>Java>>正文


Java Collections.emptyList方法代码示例

本文整理汇总了Java中java.util.Collections.emptyList方法的典型用法代码示例。如果您正苦于以下问题:Java Collections.emptyList方法的具体用法?Java Collections.emptyList怎么用?Java Collections.emptyList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.util.Collections的用法示例。


在下文中一共展示了Collections.emptyList方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setAllowedURLSchemes

import java.util.Collections; //导入方法依赖的package包/类
/**
 * Sets the list of list of schemes allowed to appear in URLs related to the encoded message. Note, the appearance
 * of schemes such as 'javascript' may open the system up to attacks (e.g. cross-site scripting attacks).
 * 
 * @param schemes URL schemes allowed to appear in a message
 */
public void setAllowedURLSchemes(String[] schemes) {
    if (schemes == null || schemes.length == 0) {
        allowedURLSchemes = Collections.emptyList();
    } else {
        List<String> temp = new ArrayList<String>();
        for (String scheme : schemes) {
            temp.add(scheme);
        }
        allowedURLSchemes = Collections.unmodifiableList(temp);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:18,代码来源:BaseSAML1MessageEncoder.java

示例2: testConstructor_NewFileRecompressionOrderNotOK

import java.util.Collections; //导入方法依赖的package包/类
@Test(expected = IllegalArgumentException.class)
public void testConstructor_NewFileRecompressionOrderNotOK() {
  new PreDiffPlan(
      Collections.<QualifiedRecommendation>emptyList(),
      SORTED_VOID_LIST,
      SORTED_DEFLATE_LIST,
      reverse(SORTED_DEFLATE_LIST));
}
 
开发者ID:lizhangqu,项目名称:CorePatch,代码行数:9,代码来源:PreDiffPlanTest.java

示例3: Range

import java.util.Collections; //导入方法依赖的package包/类
/**
 * Creates a range with the given values and "infinite" flag.
 *
 * @param values   the values that comprise this range, may be null
 * @param infinite whether this range is infinite - that is, whether the range's pattern repeats indefinitely, not null
 */
private Range(@Nullable T[] values, @Nonnull Boolean infinite) {
  requireNonNull(values);
  requireNonNull(infinite);

  this.values = values == null ? Collections.emptyList() : Collections.unmodifiableList(Arrays.asList(values));
  this.infinite = infinite;
}
 
开发者ID:lokalized,项目名称:lokalized-java,代码行数:14,代码来源:Range.java

示例4: setup

import java.util.Collections; //导入方法依赖的package包/类
@Before
public void setup() {
    playlistService = new PlaylistService(
            mediaFileDao,
            playlistDao,
            securityService,
            settingsService,
            Collections.emptyList(),
            Lists.newArrayList(defaultPlaylistImportHandler));

}
 
开发者ID:airsonic,项目名称:airsonic,代码行数:12,代码来源:PlaylistServiceTestImport.java

示例5: initializeCategories

import java.util.Collections; //导入方法依赖的package包/类
private void initializeCategories(String marketplaceId) {
    List<VOCategory> allMarketplaceCategories = Collections.emptyList();
    POMarketplacePriceModel marketplacePriceModel = null;
    POPartnerPriceModel partnerPriceModel = null;
    model.setMarketplacePriceModel(null);
    if (!ADMStringUtils.isBlank(marketplaceId)) {
        Response response;
        try {
            response = getPublishService().getCategoriesAndRvenueShare(
                    marketplaceId, getUserLanguage());
            allMarketplaceCategories = response
                    .getResultList(VOCategory.class);
            marketplacePriceModel = response
                    .getResult(POMarketplacePriceModel.class);
            partnerPriceModel = response
                    .getResult(POPartnerPriceModel.class);
        } catch (ObjectNotFoundException e) {
            ui.handleException(e);
        }
    }
    model.initializeMarketplaceCategories(allMarketplaceCategories);
    model.setMarketplacePriceModel(marketplacePriceModel == null
            ? new POMarketplacePriceModel() : marketplacePriceModel);
    model.setMarketplacePartnerPriceModel(partnerPriceModel == null
            ? new POPartnerPriceModel() : partnerPriceModel);
    initializeLists(marketplaceId, partnerPriceModel);
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:28,代码来源:MarketableServicePublishCtrl.java

示例6: ArrayEmptyList1000Encode

import java.util.Collections; //导入方法依赖的package包/类
@SuppressWarnings("rawtypes")
public ArrayEmptyList1000Encode(){
    super("ArrayEmptyList1000Encode");

    List[] array = new List[1000];
    for (int i = 0; i < array.length; ++i) {
        array[i] = Collections.emptyList();
    }
    this.object = array;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:11,代码来源:ArrayEmptyList1000Encode.java

示例7: crawlZipEntry

import java.util.Collections; //导入方法依赖的package包/类
private List<DetectedString> crawlZipEntry(ZipFile zipFile, ZipEntry zipEntry) throws IOException {
    if (!zipEntry.isDirectory()) {
        InputStream is = zipFile.getInputStream(zipEntry);
        String filename = zipEntry.getName();
        // TODO invent something better
        if (filename.endsWith(".xml")) {
            return (xmlCrawler.crawl(is)
                    .stream()
                    .map(fileStageBuilder -> fileStageBuilder.inZip(zipFile, filename))
                    .collect(Collectors.toList()));
        }
    }
    return Collections.emptyList();
}
 
开发者ID:AlexIvchenko,项目名称:digdes-2017-file-finder,代码行数:15,代码来源:BasicZipCrawler.java

示例8: RedenEindeRelatieController

import java.util.Collections; //导入方法依赖的package包/类
/**
 * Constructor.
 * @param repository repository
 */
@Inject
protected RedenEindeRelatieController(@Named("redenEindeRelatieRepository") final ReadWriteRepository<RedenBeeindigingRelatie, Short> repository) {
    super(repository,
            Arrays.asList(
                    new Filter<>(OMSCHRIJVING, new StringValueAdapter(), new LikePredicateBuilderFactory(OMSCHRIJVING)),
                    new Filter<>(CODE, new ShortValueAdapter(), new EqualPredicateBuilderFactory(CODE))),
            Collections.emptyList(),
            Arrays.asList(CODE, OMSCHRIJVING));
}
 
开发者ID:MinBZK,项目名称:OperatieBRP,代码行数:14,代码来源:RedenEindeRelatieController.java

示例9: testWriteJson

import java.util.Collections; //导入方法依赖的package包/类
@Test
public void testWriteJson() throws DigestException, IOException, URISyntaxException {
  Path jsonFile = Paths.get(Resources.getResource("json/basic.json").toURI());
  String expectedJson = new String(Files.readAllBytes(jsonFile), StandardCharsets.UTF_8);

  TestJson testJson = new TestJson();
  testJson.number = 54;
  testJson.text = "crepecake";
  testJson.digest =
      DescriptorDigest.fromDigest(
          "sha256:8c662931926fa990b41da3c9f42663a537ccd498130030f9149173a0493832ad");
  testJson.innerObject = new TestJson.InnerObject();
  testJson.innerObject.number = 23;
  testJson.innerObject.texts = Arrays.asList("first text", "second text");
  testJson.innerObject.digests =
      Arrays.asList(
          DescriptorDigest.fromDigest(
              "sha256:91e0cae00b86c289b33fee303a807ae72dd9f0315c16b74e6ab0cdbe9d996c10"),
          DescriptorDigest.fromHash(
              "4945ba5011739b0b98c4a41afe224e417f47c7c99b2ce76830999c9a0861b236"));

  TestJson.InnerObject innerObject1 = new TestJson.InnerObject();
  innerObject1.number = 42;
  innerObject1.texts = Collections.emptyList();
  TestJson.InnerObject innerObject2 = new TestJson.InnerObject();
  innerObject2.number = 99;
  innerObject2.texts = Collections.singletonList("some text");
  innerObject2.digests =
      Collections.singletonList(
          DescriptorDigest.fromDigest(
              "sha256:d38f571aa1c11e3d516e0ef7e513e7308ccbeb869770cb8c4319d63b10a0075e"));
  testJson.list = Arrays.asList(innerObject1, innerObject2);

  ByteArrayOutputStream jsonStream = new ByteArrayOutputStream();
  JsonTemplateMapper.writeJson(jsonStream, testJson);

  Assert.assertEquals(expectedJson, jsonStream.toString());
}
 
开发者ID:GoogleCloudPlatform,项目名称:minikube-build-tools-for-java,代码行数:39,代码来源:JsonTemplateMapperTest.java

示例10: setAttachments

import java.util.Collections; //导入方法依赖的package包/类
public void setAttachments(final List<Attachment> attachments) {
    this.attachments = attachments != null
            ? attachments
            : Collections.<Attachment>emptyList();

    notifyDataSetChanged();
}
 
开发者ID:PacktPublishing,项目名称:Hands-On-Android-UI-Development,代码行数:8,代码来源:AttachmentPreviewAdapter.java

示例11: subList

import java.util.Collections; //导入方法依赖的package包/类
@Override
public List<Integer> subList(int fromIndex, int toIndex) {
  int size = size();
  checkPositionIndexes(fromIndex, toIndex, size);
  if (fromIndex == toIndex) {
    return Collections.emptyList();
  }
  return new IntArrayAsList(array, start + fromIndex, start + toIndex);
}
 
开发者ID:paul-hammant,项目名称:googles-monorepo-demo,代码行数:10,代码来源:Ints.java

示例12: getNewRoleValue

import java.util.Collections; //导入方法依赖的package包/类
/**
 * Returns new value of updated role (only for role update).
 *
 * @return the new value of the updated role.
 */
public List<ObjectName> getNewRoleValue() {
    List<ObjectName> result;
    if (newRoleValue != null) {
        result = new ArrayList<ObjectName>(newRoleValue);
    } else {
        result = Collections.emptyList();
    }
    return result;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:15,代码来源:RelationNotification.java

示例13: ResultRowDifference

import java.util.Collections; //导入方法依赖的package包/类
public ResultRowDifference() {
    this(Collections.emptyList(), Collections.emptyList());
}
 
开发者ID:fbiville,项目名称:hands-on-neo4j-devoxx-fr-2017,代码行数:4,代码来源:ResultRowDifference.java

示例14: newMapperService

import java.util.Collections; //导入方法依赖的package包/类
public static MapperService newMapperService(NamedXContentRegistry xContentRegistry, Path tempDir, Settings indexSettings)
        throws IOException {
    IndicesModule indicesModule = new IndicesModule(Collections.emptyList());
    return newMapperService(xContentRegistry, tempDir, indexSettings, indicesModule);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:6,代码来源:MapperTestUtils.java

示例15: createViewManagers

import java.util.Collections; //导入方法依赖的package包/类
@Override
public List<ViewManager> createViewManagers(
                          ReactApplicationContext reactContext) {
	return Collections.emptyList();
}
 
开发者ID:AllThatSeries,项目名称:react-native-streaming-audio-player,代码行数:6,代码来源:RNAudioPlayerPackage.java


注:本文中的java.util.Collections.emptyList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。