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:ch.cyberduck.core.importer.WinScpBookmarkCollectionTest.java

@Test(expected = AccessDeniedException.class)
public void testParseNotFound() throws Exception {
    new WinScpBookmarkCollection().parse(new ProtocolFactory(Collections.emptySet()),
            new Local(System.getProperty("java.io.tmpdir"), "f"));
}

From source file:com.orange.cepheus.cep.model.EventType.java

public Set<Attribute> getAttributes() {
    if (attributes == null) {
        return Collections.emptySet();
    }
    return attributes;
}

From source file:com.pc.dailymile.domain.Friends.java

public Set<User> getFriends() {
    if (friends == null) {
        return Collections.emptySet();
    }/*from   ww w  .  java2  s . c o m*/
    return new TreeSet<User>(friends);
}

From source file:com.jxt.web.service.map.AcceptApplicationLocalCache.java

public Set<AcceptApplication> get(RpcApplication findKey) {
    final Set<AcceptApplication> hit = this.acceptApplicationLocalCache.get(findKey);
    if (hit != null) {
        if (isDebug) {
            logger.debug("acceptApplicationLocalCache hit {}:{}", findKey, hit);
        }//from  ww  w .  j av  a 2  s .co m
        return hit;
    }
    if (isDebug) {
        logger.debug("acceptApplicationLocalCache miss {}", findKey);
    }
    return Collections.emptySet();
}

From source file:ch.genevajug.crappy.providerservice.service.impl.ProviderServiceImpl.java

/**
 * {@inheritDoc}// w ww  .  j  av a2 s.c  o  m
 */
public Set<ServiceProducer> getAllServiceProviders() {
    final Set<ServiceProducer> serviceProducers = getAllServiceProducers();
    if (serviceProducers == null) {
        return Collections.emptySet();
    }
    return serviceProducers;
}

From source file:io.interface21.domain.DataLoader.java

/**
 * Callback used to run the bean./*ww w. ja  va2 s.  com*/
 *
 * @param args incoming main method arguments
 * @throws Exception on error
 */
@Override
public void run(String... args) throws Exception {
    Stream.of(new Exam[] { new Exam("1", "Systems and Signals", 20, 5400, "1.0", false, Collections.emptySet()),
            new Exam("2", "Systems and Signals", 20, 5400, "1.1", true, buildSysQuestions()) })
            .forEach(e -> repo.save(e));
}

From source file:lux.index.field.AttributeTextField.java

@Override
public Iterable<IndexableField> getFieldValues(XmlIndexer indexer) {
    XdmNode doc = indexer.getXdmNode();//  w ww.j ava 2s . com
    if (doc != null && doc.getUnderlyingNode() != null) {
        SaxonDocBuilder builder = indexer.getSaxonDocBuilder();
        Analyzer analyzer = getAnalyzer();
        TokenStream textTokens = null;
        try {
            textTokens = analyzer.tokenStream(getName(), new CharSequenceReader(""));
        } catch (IOException e) {
        }
        AttributeTokenStream tokens = new AttributeTokenStream(getName(), analyzer, textTokens, doc,
                builder.getOffsets(), indexer.getProcessor());
        return new FieldValues(this, Collections.singleton(new TextField(getName(), tokens)));
    }
    return Collections.emptySet();
}

From source file:net.metanotion.web.html.SafeString.java

@Override
public Set<String> keySet() {
    return Collections.emptySet();
}

From source file:de.topicmapslab.tmcledit.model.psiprovider.internal.Subj3ctPSIProvider.java

public Set<PSIProviderResult> getSubjectIdentifier() {
    if (getName().length() == 0)
        return Collections.emptySet();

    HttpMethod method = null;/*  ww w. j  av a  2  s .  co  m*/
    try {
        String url = "http://api.subj3ct.com/subjects/search";

        HttpClient client = new HttpClient();
        method = new GetMethod(url);

        ArrayList<NameValuePair> params = new ArrayList<NameValuePair>(2);
        params.add(new NameValuePair("format", "xml"));
        params.add(new NameValuePair("query", getName()));
        method.setQueryString(params.toArray(new NameValuePair[params.size()]));

        client.getParams().setSoTimeout(5000);
        client.executeMethod(method);

        String result = method.getResponseBodyAsString();

        SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
        Subj3ctXmlHandler handler = new Subj3ctXmlHandler();
        parser.parse(new InputSource(new StringReader(result)), handler);

        List<Subje3ctResult> resultList = handler.getResultList();
        if (resultList.size() == 0) {
            return Collections.emptySet();
        }

        Set<PSIProviderResult> resultSet = new HashSet<PSIProviderResult>(resultList.size());
        for (Subje3ctResult r : resultList) {
            String description = "";
            if (r.name != null)
                description = "Name: " + r.name + "\n";
            if (r.description != null)
                description += "Description: " + r.description + "\n";

            description += "\n\nThis service is provided by http://www.subj3ct.com";

            resultSet.add(new PSIProviderResult(r.identifier, description));
        }

        return Collections.unmodifiableSet(resultSet);
    } catch (UnknownHostException e) {
        // no http connection -> no results
        TmcleditEditPlugin.logInfo(e);
        return Collections.emptySet();
    } catch (SocketTimeoutException e) {
        // timeout -> no results
        TmcleditEditPlugin.logInfo(e);
        return Collections.emptySet();
    } catch (Exception e) {
        throw new RuntimeException(e);
    } finally {
        if (method != null)
            method.releaseConnection();
    }
}

From source file:com.navercorp.pinpoint.web.service.map.AcceptApplicationLocalCacheV1.java

public void put(String host, Set<AcceptApplication> acceptApplicationSet) {

    if (CollectionUtils.isEmpty(acceptApplicationSet)) {
        // initialize for empty value
        Set<AcceptApplication> emptySet = Collections.emptySet();
        acceptApplicationLocalCacheV1.put(host, emptySet);
        return;/*  www .  j  a  v  a 2 s  . c o m*/
    }
    // build cache
    for (AcceptApplication acceptApplication : acceptApplicationSet) {
        Set<AcceptApplication> findSet = acceptApplicationLocalCacheV1.get(acceptApplication.getHost());
        if (findSet == null) {
            findSet = new HashSet<AcceptApplication>();
            acceptApplicationLocalCacheV1.put(acceptApplication.getHost(), findSet);
        }
        findSet.add(acceptApplication);
    }
}