List of usage examples for org.apache.commons.lang3 StringUtils join
public static String join(final Iterable<?> iterable, final String separator)
Joins the elements of the provided Iterable into a single String containing the provided elements.
No delimiter is added before or after the list.
From source file:com.msopentech.odatajclient.engine.uri.filter.ODataFilterFunction.java
@Override public String build() { final String[] strParams = new String[params.length]; for (int i = 0; i < params.length; i++) { strParams[i] = params[i].build(); }/* w ww. j a v a 2s .c o m*/ return new StringBuilder(function).append('(').append(StringUtils.join(strParams, ',')).append(')') .toString(); }
From source file:com.thoughtworks.go.util.StringUtil.java
public static String humanize(String s) { String[] strings = StringUtils.splitByCharacterTypeCamelCase(s); for (int i = 0; i < strings.length; i++) { String string = strings[i]; strings[i] = string.toLowerCase(); }//w w w .j a va 2s. c o m return StringUtils.join(strings, " "); }
From source file:annis.sqlgen.CorpusPathWhereClauseGenerator.java
@Override public String fromClause(QueryData queryData, List<QueryNode> alternative, String indent) { List<String> tables = new ArrayList<String>(); for (int i = 0; i < alternative.size(); i++) { QueryNode n = alternative.get(i); tables.add("corpus" + " AS corpus" + (i + 1)); }// ww w . j ava 2 s . c o m return StringUtils.join(tables, ", " + indent + TABSTOP); }
From source file:com.spartasystems.holdmail.mapper.MessageSummaryMapper.java
public MessageSummary toMessageSummary(Message message) { MessageContent messageContent = message.getContent(); return new MessageSummary(message.getMessageId(), message.getIdentifier(), message.getSubject(), message.getSenderEmail(), message.getReceivedDate(), message.getSenderHost(), message.getMessageSize(), StringUtils.join(message.getRecipients(), ","), message.getRawMessage(), message.getHeaders().asMap(), messageContent.findFirstTextPart(), messageContent.findFirstHTMLPart()); }
From source file:com.thinkbiganalytics.metadata.jpa.jobrepo.nifi.NifiEventProvider.java
public static NifiEvent toNifiEvent(ProvenanceEventRecordDTO eventRecordDTO) { JpaNifiEvent nifiEvent = new JpaNifiEvent( new JpaNifiEvent.NiFiEventPK(eventRecordDTO.getEventId(), eventRecordDTO.getFlowFileUuid())); nifiEvent.setFeedName(eventRecordDTO.getFeedName()); nifiEvent.setEventTime(eventRecordDTO.getEventTime()); nifiEvent.setEventDetails(eventRecordDTO.getDetails()); nifiEvent.setEventDuration(eventRecordDTO.getEventDuration()); nifiEvent.setFeedProcessGroupId(eventRecordDTO.getFeedProcessGroupId()); nifiEvent.setEventType(eventRecordDTO.getEventType()); nifiEvent.setProcessorId(eventRecordDTO.getComponentId()); nifiEvent.setProcessorName(eventRecordDTO.getComponentName()); nifiEvent.setFileSize(eventRecordDTO.getFileSize()); nifiEvent.setFileSizeBytes(eventRecordDTO.getFileSizeBytes()); nifiEvent.setParentFlowFileIds(StringUtils.join(eventRecordDTO.getParentFlowFileIds(), ",")); nifiEvent.setChildFlowFileIds(StringUtils.join(eventRecordDTO.getChildUuids(), ",")); nifiEvent.setJobFlowFileId(eventRecordDTO.getJobFlowFileId()); nifiEvent.setIsStartOfJob(eventRecordDTO.isStartOfJob()); nifiEvent.setIsEndOfJob(eventRecordDTO.isEndOfJob()); nifiEvent.setSourceConnectionId(eventRecordDTO.getSourceConnectionIdentifier()); String attributesJSON = ObjectMapperSerializer.serialize(eventRecordDTO.getAttributeMap()); nifiEvent.setAttributesJson(attributesJSON); nifiEvent.setIsFinalJobEvent(eventRecordDTO.isFinalJobEvent()); nifiEvent.setIsFailure(eventRecordDTO.isFailure()); nifiEvent.setIsBatchJob(eventRecordDTO.isBatchJob()); nifiEvent.setHasFailureEvents(eventRecordDTO.isHasFailedEvents()); nifiEvent.setClusterNodeAddress(eventRecordDTO.getClusterNodeAddress()); nifiEvent.setClusterNodeId(eventRecordDTO.getClusterNodeId()); return nifiEvent; }
From source file:com.gqshao.mail.service.SimpleMailService.java
/** * ??.// ww w . j a va2 s . c om */ public void sendNotificationMail(String userName) { SimpleMailMessage msg = new SimpleMailMessage(); msg.setFrom("springside3.demo@gmail.com"); msg.setTo("springside3.demo@gmail.com"); msg.setSubject(""); // ???? String content = String.format(textTemplate, userName, new Date()); msg.setText(content); try { mailSender.send(msg); if (logger.isInfoEnabled()) { logger.info("??{}", StringUtils.join(msg.getTo(), ",")); } } catch (Exception e) { logger.error("??", e); } }
From source file:dev.maisentito.suca.commands.EnitCommandHandler.java
@Override public void handleCommand(MessageEvent event, String[] args) throws Throwable { Document doc = Jsoup.connect("http://www.wordreference.com/enit/" + StringUtils.join(args, ' ')) .userAgent(getStringGlobal(Main.GLOBAL_USERAGENT, "")).referrer("http://www.google.com/").get(); Elements row = doc.body().select("table.WRD:nth-child(2) > tbody:nth-child(1) > tr:nth-child(2)"); row.select(".tooltip").remove(); String def = row.text().trim().replace("\n", ""); event.respond(def);//from w w w . j a v a2 s .c o m }
From source file:dev.maisentito.suca.commands.ItenCommandHandler.java
@Override public void handleCommand(MessageEvent event, String[] args) throws Throwable { Document doc = Jsoup.connect("http://www.wordreference.com/iten/" + StringUtils.join(args, ' ')) .userAgent(getStringGlobal(Main.GLOBAL_USERAGENT, "")).referrer("http://www.google.com/").get(); Elements row = doc.body().select("table.WRD:nth-child(2) > tbody:nth-child(1) > tr:nth-child(2)"); row.select(".tooltip").remove(); String def = row.text().trim().replace("\n", ""); event.respond(def);/*from w w w . j a va2 s. c o m*/ }
From source file:com.ait.lienzo.test.stub.overlays.JsArray.java
public String join(final String separator) { return StringUtils.join(list, separator); }
From source file:com.thoughtworks.go.util.command.InMemoryConsumer.java
public String toString() { return StringUtils.join(asList(), "\n"); }