Example usage for java.util Collections emptySet

List of usage examples for java.util Collections emptySet

Introduction

In this page you can find the example usage for java.util Collections emptySet.

Prototype

@SuppressWarnings("unchecked")
public static final <T> Set<T> emptySet() 

Source Link

Document

Returns an empty set (immutable).

Usage

From source file:com.evolveum.midpoint.model.impl.lens.UndefinedEvaluationOrderImpl.java

@Override
public Set<QName> getRelations() {
    return Collections.emptySet();
}

From source file:eu.domibus.ebms3.receiver.FaultInHandler.java

@Override
public Set<QName> getHeaders() {
    return Collections.emptySet();
}

From source file:com.joyent.manta.http.MantaSSLConnectionSocketFactory.java

/**
 * Creates a new instance using the configuration parameters.
 * @param config configuration context containing SSL config params
 *//*from w  w  w  .  j  av a 2s .  c om*/
public MantaSSLConnectionSocketFactory(final ConfigContext config) {
    super(buildContext(), MantaUtils.csv2array(config.getHttpsProtocols()),
            MantaUtils.csv2array(config.getHttpsCipherSuites()), getDefaultHostnameVerifier());

    if (config.getHttpsProtocols() != null) {
        this.supportedProtocols = new LinkedHashSet<>(MantaUtils.fromCsv(config.getHttpsProtocols()));
    } else {
        this.supportedProtocols = Collections.emptySet();
    }

    if (config.getHttpsCipherSuites() != null) {
        this.supportedCipherSuites = new LinkedHashSet<>(MantaUtils.fromCsv(config.getHttpsCipherSuites()));
    } else {
        this.supportedCipherSuites = Collections.emptySet();
    }
}

From source file:hudson.plugins.sonar.utils.AbstractPathResolver.java

public Set<String> resolvePath(FilePath workspace, String pathPattern)
        throws IOException, InterruptedException {
    if (workspace == null || StringUtils.isBlank(pathPattern)) {
        return Collections.emptySet();
    }/*  w  w  w .j  a  v a2s.c  o  m*/

    return doResolvePath(workspace, pathPattern);
}

From source file:org.mybatis.spring.boot.test.autoconfigure.MybatisTypeExcludeFilter.java

@Override
protected Set<Class<?>> getComponentIncludes() {
    return Collections.emptySet();
}

From source file:com.hortonworks.streamline.streams.runtime.storm.event.sample.StreamlineEventLogger.java

@Override
protected String buildLogMessage(EventInfo event) {
    String timestampStr = dateFormat.format(event.getTs());

    List<Object> values = event.getValues();
    if (!values.isEmpty()) {
        final Object eventObj = values.get(0);

        if (eventObj instanceof StreamlineEvent) {
            final StreamlineEvent slEvent = (StreamlineEvent) eventObj;

            Set<String> rootIds;
            if (EventCorrelationInjector.containsRootIds(slEvent)) {
                rootIds = EventCorrelationInjector.getRootIds(slEvent);
            } else {
                rootIds = Collections.emptySet();
            }//from   w  ww. ja v a2  s.  co m

            Set<String> parentIds;
            if (EventCorrelationInjector.containsParentIds(slEvent)) {
                parentIds = EventCorrelationInjector.getParentIds(slEvent);
            } else {
                parentIds = Collections.emptySet();
            }

            // Date, Marker, Component Name (Streamline), Event ID, Root IDs, Parent IDs,
            // Event Fields, Header KV, Aux. Fields KV
            // use DELIMITER to let parser understand it more easily
            String format = String.join(DELIMITER,
                    new String[] { "%s", "%s", "%s", "%s", "%s", "%s", "%s", "%s", "%s" });

            return String.format(format, timestampStr, MARKER_FOR_STREAMLINE_EVENT,
                    StormTopologyUtil.extractStreamlineComponentName(event.getComponent()), slEvent.getId(),
                    rootIds, parentIds, ImmutableMap.copyOf(slEvent), slEvent.getHeader().toString(),
                    slEvent.getAuxiliaryFieldsAndValues().toString());
        }
    }

    // Date, Marker, Component Name (Storm), task ID, Message ID, Values
    // use comma-separated delimiter since this is not for machine, but for users
    Object messageId = event.getMessageId();
    return String.format("%s,%s,%s,%s,%s,%s", timestampStr, MARKER_FOR_OTHER_EVENT, event.getComponent(),
            String.valueOf(event.getTask()), (messageId == null ? "" : messageId.toString()), values);
}

From source file:com.redhat.red.offliner.ftest.ChecksumMismatchFTest.java

@Test
public void run() throws Exception {
    // We only need one repo server.
    TestRepositoryServer server = newRepositoryServer();

    // Generate some test content
    byte[] expectedContent = contentGenerator.newBinaryContent(1024);
    byte[] downloadedContent = contentGenerator.newBinaryContent(1024);

    TrackedContentEntryDTO dto = contentGenerator.newRemoteContentEntry(new StoreKey(StoreType.remote, "test"),
            "jar", server.getBaseUri(), expectedContent);

    TrackedContentDTO record = new TrackedContentDTO(new TrackingKey("test-record"), Collections.emptySet(),
            Collections.singleton(dto));

    String path = dto.getPath();//  www.  j av  a  2  s  .com

    // Register the generated content by writing it to the path within the repo server's dir structure.
    // This way when the path is requested it can be downloaded instead of returning a 404.
    server.registerContent(path, downloadedContent);
    server.registerContent(path + Main.SHA_SUFFIX, sha1Hex(downloadedContent));
    server.registerContent(path + Main.MD5_SUFFIX, md5Hex(downloadedContent));

    // Write the plaintext file we'll use as input.
    File foloRecord = temporaryFolder.newFile("folo." + getClass().getSimpleName() + ".json");

    FileUtils.write(foloRecord, objectMapper.writeValueAsString(record));

    Options opts = new Options();
    opts.setBaseUrls(Collections.singletonList(server.getBaseUri()));

    // Capture the downloads here so we can verify the content.
    File downloads = temporaryFolder.newFolder();

    opts.setDownloads(downloads);
    opts.setLocations(Collections.singletonList(foloRecord.getAbsolutePath()));

    Main main = run(opts);
    assertThat("Wrong number of downloads logged. Should have been just the checksum files.",
            main.getDownloaded(), equalTo(2));
    assertThat("Checksum mismatch should have resulted in an error", main.getErrors().isEmpty(),
            equalTo(false));

    assertThat("The downloaded file should not have been kept.", new File(downloads, path).exists(),
            equalTo(false));
}

From source file:io.gravitee.repository.mongodb.management.MongoApiKeyRepository.java

private Set<ApiKey> map(Collection<ApiAssociationMongo> apiAssociationMongos) {
    if (apiAssociationMongos == null) {
        return Collections.emptySet();
    }// w w  w  .  jav a2s . c o  m

    return apiAssociationMongos.stream().map(apiAssociationMongo -> {
        ApiKey key = mapper.map(apiAssociationMongo.getKey(), ApiKey.class);
        key.setApi(apiAssociationMongo.getApi().getId());
        key.setApplication(apiAssociationMongo.getApplication().getId());

        return key;
    }).collect(Collectors.toSet());
}

From source file:org.mitre.openid.connect.service.impl.DummyResourceSetService.java

@Override
public Collection<ResourceSet> getAllForClient(ClientDetailsEntity client) {
    return Collections.emptySet();
}

From source file:io.seldon.clustering.recommender.ItemCategoryClusterCountsRecommender.java

@Override
public ItemRecommendationResultSet recommend(String client, Long user, int dimensionId, int maxRecsCount,
        RecommendationContext ctxt, List<Long> recentItemInteractions) {
    if (ctxt.getCurrentItem() != null) {
        Set<Long> exclusions = Collections.emptySet();
        if (ctxt.getMode() == RecommendationContext.MODE.EXCLUSION) {
            exclusions = ctxt.getContextItems();
        }/*from   w  w  w .j a v  a2  s .  c  o m*/
        Integer dimId = getDimensionForAttrName(ctxt.getCurrentItem(), client, ctxt);
        if (dimId != null) {
            CountRecommender r = cUtils.getCountRecommender(client);
            if (r != null) {
                Double decayRate = ctxt.getOptsHolder().getDoubleOption(DECAY_RATE_OPTION_NAME);
                long t1 = System.currentTimeMillis();
                Map<Long, Double> recommendations = r.recommendGlobal(dimensionId, maxRecsCount, exclusions,
                        decayRate, dimId);
                long t2 = System.currentTimeMillis();
                logger.debug("Recommendation via cluster counts for dimension " + dimId + " for item  "
                        + ctxt.getCurrentItem() + " for user " + user + " took " + (t2 - t1));
                List<ItemRecommendationResultSet.ItemRecommendationResult> results = new ArrayList<>();
                for (Map.Entry<Long, Double> entry : recommendations.entrySet()) {
                    results.add(new ItemRecommendationResultSet.ItemRecommendationResult(entry.getKey(),
                            entry.getValue().floatValue()));
                }
                return new ItemRecommendationResultSet(results, name);

            } else
                logger.warn("Can't get count recommender for " + client);
        } else
            logger.info("Can't get dim for item " + ctxt.getCurrentItem()
                    + " so can't run cluster counts for dimension algorithm ");
    } else
        logger.info("Can't cluster count for category for user " + user + " client user id "
                + ctxt.getCurrentItem() + " as no current item passed in");

    return new ItemRecommendationResultSet(Collections.EMPTY_LIST, name);
}