List of usage examples for org.apache.commons.lang StringUtils join
public static String join(Collection<?> collection, String separator)
Joins the elements of the provided Collection
into a single String containing the provided elements.
From source file:com.microsoft.azure.shortcuts.services.samples.CloudServicesSample.java
public static void test(Azure azure) throws Exception { final String serviceName = "svc" + String.valueOf(System.currentTimeMillis()); System.out.println(String.format("Creating cloud service named '%s'...", serviceName)); // Create a new cloud service azure.cloudServices().define(serviceName).withRegion("West US").create(); // List cloud service names Set<String> cloudServiceNames = azure.cloudServices().asMap().keySet(); System.out.println("Available cloud services: " + StringUtils.join(cloudServiceNames, ", ")); // Get cloud service info CloudService cloudService = azure.cloudServices(serviceName); printCloudService(cloudService);/*from www . j a v a 2 s. c o m*/ // Update cloud service System.out.println(String.format("Updating cloud service named '%s'...", serviceName)); azure.cloudServices().update(serviceName).withDescription("Updated").withLabel("Updated").apply(); cloudService = azure.cloudServices(serviceName); printCloudService(cloudService); // Delete the newly created cloud service System.out.println(String.format("Deleting cloud service named '%s'...", serviceName)); azure.cloudServices().delete(serviceName); // List all cloud services Collection<CloudService> cloudServices = azure.cloudServices().asMap().values(); for (CloudService c : cloudServices) { printCloudService(c); } }
From source file:com.alta189.bukkit.script.functions.PrintFunction.java
@Override public Object call(Context cx, Scriptable scope, Scriptable thisObj, Object[] args) { if (args.length < 1) { return null; }// ww w . java 2s. c om String str = StringUtils.join(args, " "); BScript.getInstance().info(tag + str); return super.call(cx, scope, thisObj, args); }
From source file:de.tudarmstadt.ukp.dkpro.core.toolbox.core.Text.java
public String getFormattedString() { return "[" + StringUtils.join(getSentences(), ' ') + "]"; }
From source file:jmona.io.SplitOnColonTester.java
/** * Test method for {@link jmona.io.SplitOnColon#execute(java.lang.String)}. *//* w w w . ja va2 s . co m*/ @Test public void testExecute() { final String string = StringUtils.join(PIECES, ':'); assertArrayEquals(PIECES, new SplitOnColon().execute(string)); }
From source file:com.gs.obevo.util.ArgsParser.java
public <T> T parse(String[] args, T inputArgs) { try {//from ww w.j a v a 2s . c o m List<String> extraArgs = Args.parse(inputArgs, args); if (extraArgs.size() > 0) { Args.usage(inputArgs); System.err.println("Passed in unnecessary args: " + StringUtils.join(extraArgs, "; ")); System.exit(-1); } } catch (IllegalArgumentException exc) { Args.usage(inputArgs); exc.printStackTrace(); System.exit(-1); } LOG.info("Arguments parsed: " + inputArgs.toString()); return inputArgs; }
From source file:com.iflytek.edu.cloud.frame.spring.ProfileApplicationContextInitializer.java
@Override public void initialize(ConfigurableApplicationContext applicationContext) { String[] profiles = EnvUtil.getSpringProfiles(); applicationContext.getEnvironment().setActiveProfiles(profiles); _logger.info("Active spring profile: {}", StringUtils.join(profiles, ",")); }
From source file:jp.go.nict.langrid.p2pgridbasis.platform.jxta.impl.RequiredPropertyNotFoundException.java
/** * * */ public RequiredPropertyNotFoundException(Collection<String> propName) { this(StringUtils.join(propName.iterator(), ",")); }
From source file:de.interactive_instruments.ShapeChange.FOL.StringLiteralList.java
@Override public String toString() { if (values != null) { return StringUtils.join(values, ","); } else {/* www.java 2 s. c o m*/ return "<null-StringList>"; } }
From source file:nc.noumea.mairie.organigramme.enums.StatutFichePoste.java
/** * Renvoi la liste des ids de statut actif spar par des virgules (utile * pour le WS SIRH)//from ww w. j av a2s . c o m * * @return : la liste des ids de statut actif spar par des virgules */ public static String getListIdStatutActif() { List<String> listIdStatutActive = new ArrayList<String>(); for (StatutFichePoste statutFichePoste : StatutFichePoste.values()) { if (!statutFichePoste.equals(StatutFichePoste.INACTIVE)) { listIdStatutActive.add(statutFichePoste.getId()); } } return StringUtils.join(listIdStatutActive, ","); }
From source file:gov.nih.nci.cabig.caaers.dao.query.SafetySignalingQuery.java
public SafetySignalingQuery(String... selections) { super("select distinct " + AE_ALIAS + ", " + StringUtils.join(selections, ", ") + " from AdverseEvent " + AE_ALIAS);//from www. j a v a2s. c o m }