List of usage examples for java.util Collections emptySet
@SuppressWarnings("unchecked") public static final <T> Set<T> emptySet()
From source file:com.vitesify.languidmpd.streams.TestMPDStreamProcessor.java
@Test public void test_send_single_command() throws IOException { InputStream is = new ReaderInputStream(new StringReader("OK\nOK\nNOT OK\nOK"), Charset.forName("UTF-8")); OutputStream os = new NullOutputStream(); MPDStreamProcesser mpdsp = new MPDStreamProcesser(is, os); Set<String> s = Collections.emptySet(); assertTrue(mpdsp.send_command(Message.STATUS, s)); assertTrue(mpdsp.last_command_succeeded()); assertTrue(mpdsp.get_return_code().endsWith("NOT OK\n")); }
From source file:org.jasig.springframework.web.client.HttpServletProxyResponse.java
public HttpServletProxyResponse(HttpServletResponse servletResponse) { this.servletResponse = servletResponse; this.excludedHeaders = Collections.emptySet(); }
From source file:org.jasig.springframework.web.client.PortletResourceProxyResponse.java
public PortletResourceProxyResponse(ResourceResponse resourceResponse) { this.resourceResponse = resourceResponse; this.excludedHeaders = Collections.emptySet(); }
From source file:ch.cyberduck.cli.SingleTransferItemFinder.java
@Override public Set<TransferItem> find(final CommandLine input, final TerminalAction action, final Path remote) { if (input.getOptionValues(action.name()).length == 2) { switch (action) { case download: return new DownloadTransferItemFinder().find(input, action, remote); case upload: case synchronize: return new UploadTransferItemFinder().find(input, action, remote); }/*from w ww . j av a 2 s . com*/ } else { switch (action) { case upload: case synchronize: return Collections.emptySet(); } } // Relative to current working directory using prefix finder. return Collections .singleton(new TransferItem(remote, LocalFactory.get(prefixer.normalize(remote.getName())))); }
From source file:lux.index.field.ElementTextField.java
@Override public Iterable<IndexableField> getFieldValues(XmlIndexer indexer) { XdmNode doc = indexer.getXdmNode();/*from w ww .j av a2s . c o m*/ 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) { } XmlTokenStreamBase tokens = new ElementTokenStream(getName(), analyzer, textTokens, doc, builder.getOffsets(), indexer.getProcessor()); tokens.configureElementVisibility(indexer); return new FieldValues(this, Collections.singleton(new TextField(getName(), tokens))); } return Collections.emptySet(); }
From source file:com.epam.ta.reportportal.ws.validation.JaskonRequiredPropertiesValidatorTest.java
@Test public void testRequiredFields() { StartLaunchRQ startLaunchRQ = new StartLaunchRQ(); startLaunchRQ.setDescription("some description"); startLaunchRQ.setName("some launch name"); startLaunchRQ.setTags(Collections.emptySet()); JaskonRequiredPropertiesValidator validator = new JaskonRequiredPropertiesValidator(); Errors errors = new BeanPropertyBindingResult(startLaunchRQ, "startLaunchRq"); validator.validate(startLaunchRQ, errors); Assert.assertThat(errors.getAllErrors(), not(empty())); Assert.assertThat(errors.getFieldError("startTime"), not(nullValue())); }
From source file:com.velix.jmongo.MongoImpl.java
private static Set<InetSocketAddress> getUniqueHosts(List<String> hosts) { if (null == hosts) { return Collections.emptySet(); }/*from w w w . java 2 s. c o m*/ Set<InetSocketAddress> ret = new HashSet<InetSocketAddress>(hosts.size()); for (String host : hosts) { ret.add(parseInetSocketAddress(host)); } return ret; }
From source file:controllers.Projects.java
public static void view(Long id) { models.Project project = getProject(id); User user = getUser();/*ww w .j ava 2s . c o m*/ Set<User> otherOwners = Collections.emptySet(); if (user.isAdmin || project.status == ProjectStatus.CONFIRMED) { List<models.Project> otherProjects = models.Project.find("moduleName = ? AND status = ? AND owner != ?", project.moduleName, ProjectStatus.CONFIRMED, project.owner).fetch(); otherOwners = new HashSet<User>(); for (models.Project otherProject : otherProjects) otherOwners.add(otherProject.owner); } render(project, otherOwners); }
From source file:com.mgmtp.jfunk.data.generator.data.IndexedFields.java
public Set<FieldSet> getFieldSets(final String dataKey) { Set<FieldSet> result = fieldSetsMap.get(dataKey); if (result != null) { return Collections.unmodifiableSet(result); }/*from ww w. j a v a 2 s . c om*/ return Collections.emptySet(); }
From source file:com.create.application.configuration.security.ClientConfiguration.java
@Bean @ConfigurationProperties("security.oauth2.client") public BaseClientDetails oauth2ClientDetails(OAuth2ClientProperties client) { BaseClientDetails details = new BaseClientDetails(); details.setClientId(client.getClientId()); details.setClientSecret(client.getClientSecret()); details.setAuthorities(getAuthorities()); details.setRegisteredRedirectUri(Collections.emptySet()); return details; }