List of usage examples for org.apache.commons.lang StringUtils join
public static String join(Object[] array)
Joins the elements of the provided array into a single String containing the provided list of elements.
From source file:com.uber.stream.kafka.mirrormaker.manager.utils.ManagerRequestURLBuilder.java
public Request postInstanceRebalance() { String requestUrl = StringUtils.join(new String[] { _baseUrl, "/admin/force_rebalance" }); Request request = new Request(Method.POST, requestUrl); return request; }
From source file:com.uber.stream.kafka.mirrormaker.controller.utils.ControllerRequestURLBuilder.java
public Request getTopicDeleteRequestUrl(String topic) { String requestUrl = StringUtils.join(new String[] { _baseUrl, "/topics/", topic }); Request request = new Request(Method.DELETE, requestUrl); return request; }
From source file:com.intel.cosbench.driver.generator.NumericNameGenerator.java
@Override public String next(Random random, int idx, int all) { int value = generator.next(random, idx, all); return StringUtils.join(new Object[] { prefix, value, suffix }); }
From source file:com.syaku.commons.PageNavigator.java
/** * @method : setPageIndex/*from w ww . ja v a2 s . c om*/ * @brief */ public void setPageIndex(int total_count) { this.total_count = total_count; total_page = ((this.total_count - 1) / page_row) + 1; start_page = ((page - 1) / page_link) * page_link + 1; now_page = (start_page / page_link) + 1; end_page = start_page + (page_link - 1); start_idx = (page - 1) * page_row; virtual_idx = total_count - (page_row * (page - 1)); log.info(StringUtils.join(new String[] { "{PageNavigator.setPageIndex}\r\n", "==========================================================================\r\n", "> total_count : ", ObjectUtils.toString(this.total_count), "\r\n", "> page_row : ", ObjectUtils.toString(page_row), "\r\n", "> page_link : ", ObjectUtils.toString(page_link), "\r\n", "> page : ", ObjectUtils.toString(page), "\r\n", "> total_page : ", ObjectUtils.toString(total_page), "\r\n", "> start_page : ", ObjectUtils.toString(start_page), "\r\n", "> now_page : ", ObjectUtils.toString(now_page), "\r\n", "> end_page : ", ObjectUtils.toString(end_page), "\r\n", "> start_idx : ", ObjectUtils.toString(start_idx), "\r\n", "> virtual_idx : ", ObjectUtils.toString(virtual_idx), "\r\n", "==========================================================================" })); }
From source file:com.uber.stream.kafka.mirrormaker.common.utils.ManagerRequestURLBuilder.java
public Request getTopicDeleteRequestUrl(String topic, String src, String dst) { String requestUrl = StringUtils .join(new String[] { _baseUrl, "/topics/", topic, "?src=", src, "&dst=", dst }); Request request = new Request(Method.DELETE, requestUrl); return request; }
From source file:jp.co.ntts.vhut.exception.DBStillReferencedRuntimeException.java
/** * @param target/* ww w . j a v a 2 s . c om*/ * @param referencings * @return */ private static Object[] createArgs(IIdentifiableEntity target, IIdentifiableEntity[] referencings) { String targetClass = target.getClass().getName(); String targetId = target.getId().toString(); String referencingClass = null; String idlist = null; if (referencings.length > 0) { referencingClass = referencings[0].getClass().getName(); List<Long> ids = new ArrayList<Long>(); for (IIdentifiableEntity referencig : referencings) { ids.add(referencig.getId()); } idlist = StringUtils.join(ids.toArray(new Long[0])); } return new Object[] { targetClass, targetId, referencingClass, idlist }; }
From source file:me.buildcarter8.FreedomOpMod.Commands.Command_adminchat.java
public boolean onCommand(CommandSender sender, Command cmd, String lbl, String[] args) { if (args.length == 0) { if (FOP_Util.isConsole(sender)) { sender.sendMessage("Only in-game players can toggle admin chat."); return true; }// w w w .j a va 2s . co m Player p = (Player) sender; PlayerData pd = PlayerData.getPlayerData(p); if (!pd.inAdminChat()) { pd.setAdminChat(true); sender.sendMessage("Now talking in admin chat."); return true; } pd.setAdminChat(false); sender.sendMessage("Now talking in regular chat."); return true; } FOP_Util.adminChat(sender, StringUtils.join(args)); return true; }
From source file:gobblin.util.guid.Guid.java
/** * Generate a {@link Guid} for an array of Strings. * @param strings array of Strings.// w w w. j a v a2 s . c o m * @return a single {@link Guid} for the array. * @throws IOException */ public static Guid fromStrings(String... strings) throws IOException { if (strings == null || strings.length == 0) { throw new IOException("Attempting to compute guid for an empty array."); } return new Guid(StringUtils.join(strings).getBytes(Charsets.UTF_8)); }
From source file:com.intel.cosbench.driver.iterator.NumericNameIterator.java
@Override public String next(String curr, int idx, int all) { int value;/*from www .ja va 2 s. co m*/ if (StringUtils.isEmpty(curr)) { if ((value = iterator.next(0, idx, all)) <= 0) return null; return StringUtils.join(new Object[] { prefix, value, suffix }); } curr = StringUtils.removeStart(curr, prefix); curr = StringUtils.removeEnd(curr, suffix); if ((value = iterator.next(Integer.parseInt(curr), idx, all)) <= 0) return null; return StringUtils.join(new Object[] { prefix, value, suffix }); }
From source file:com.titankingdoms.dev.titanchat.command.defaults.PlaceCommand.java
@Override public void execute(CommandSender sender, Channel channel, String[] args) { Participant participant = plugin.getParticipantManager().getParticipant(args[0]); if (channel.isLinked(plugin.getParticipantManager().getParticipant(sender))) { sendMessage(sender, participant.getDisplayName() + " &4is already on the channel"); return;/* w w w . j a v a 2 s . c o m*/ } String reason = StringUtils.join(Arrays.copyOfRange(args, 1, args.length)); channel.link(participant); participant.notice("&4You have been placed in " + channel.getName() + ": " + reason); if (!channel.isLinked(plugin.getParticipantManager().getParticipant(sender))) sendMessage(sender, participant.getDisplayName() + " &6has been placed"); channel.notice(participant.getDisplayName() + " &6has been placed"); }