List of usage examples for java.util Collections singletonList
public static <T> List<T> singletonList(T o)
From source file:com.stratio.ingestion.morphline.geoip.SGeoIPBuilder.java
@Override public Collection<String> getNames() { return Collections.singletonList(COMMAND_NAME); }
From source file:pl.bristleback.server.bristle.action.client.strategy.SingleUserSenderStrategy.java
@Override public List<UserContext> chooseRecipients(UserContext user, ClientActionInformation actionInformation) throws Exception { return Collections.singletonList(user); }
From source file:com.netflix.spinnaker.clouddriver.kubernetes.v2.security.KubernetesSelector.java
public static KubernetesSelector equals(String key, String value) { return new KubernetesSelector(Kind.EQUALS, key, Collections.singletonList(value)); }
From source file:eu.over9000.cathode.data.parameters.SearchChannelOptions.java
@Override public List<NameValuePair> buildParamPairs() { if (query == null) { return Collections.emptyList(); }// w ww . ja v a 2 s. c o m return Collections.singletonList(new BasicNameValuePair("query", query)); }
From source file:io.seldon.trust.impl.filters.base.CurrentItemFilter.java
@Override public List<Long> produceExcludedItems(String client, Long user, String clientUserId, RecommendationContext.OptionsHolder optsHolder, Long currentItem, String lastRecListUUID, int numRecommendations) { return Collections.singletonList(currentItem); }
From source file:org.jasig.cas.web.flow.SelectiveFlowHandlerAdapter.java
public void setSupportedFlowId(final String flowId) { this.supportedFlowIds = Collections.singletonList(flowId); }
From source file:com.linecorp.bot.model.message.ImagemapMessageTest.java
@Test public void test() throws JsonProcessingException { ObjectMapper objectMapper = new ObjectMapper().registerModule(new JavaTimeModule()) .configure(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS, false); ImagemapMessage imagemapMessage = new ImagemapMessage("https://example.com", "hoge", new ImagemapBaseSize(1040, 1040), Collections.singletonList(new MessageImagemapAction("hoge", new ImagemapArea(0, 0, 20, 20)))); String s = objectMapper.writeValueAsString(imagemapMessage); assertThat(s).contains("\"type\":\"imagemap\""); }
From source file:org.apache.niolex.commons.mail.EmailUtil.java
/** * Send a HTML email to this person./*w ww . j av a 2 s . c o m*/ * * @param from the email sender * @param to the email receiver * @param title the email title * @param text the email body * @throws MailException * @throws MessagingException */ public static void sendHtmlMail(String from, String to, String title, String text) throws MailException, MessagingException { sendMail(from, Collections.singletonList(to), title, text, null, null, true, "UTF-8"); }
From source file:ca.uhn.fhir.rest.method.BaseJavaPrimitiveBinder.java
@SuppressWarnings("unchecked") @Override/*from w w w . ja va2 s . co m*/ public List<IQueryParameterOr<?>> encode(FhirContext theContext, T theString) throws InternalErrorException { String retVal = doEncode(theString); if (isBlank(retVal)) { return Collections.emptyList(); } List<?> retValList = Collections.singletonList(MethodUtil.singleton(new StringParam(retVal), null)); return (List<IQueryParameterOr<?>>) retValList; }
From source file:com.codecrate.shard.transfer.excel.ExcelObjectImporter.java
public Collection getSupportedFileExtensions() { return Collections.singletonList(EXCEL_FILE_EXTENSION); }