Example usage for java.lang String concat

List of usage examples for java.lang String concat

Introduction

In this page you can find the example usage for java.lang String concat.

Prototype

public String concat(String str) 

Source Link

Document

Concatenates the specified string to the end of this string.

Usage

From source file:com.adobe.acs.commons.util.InfoWriterTest.java

@Test
public void testLine() throws Exception {
    String expected = StringUtils.repeat("-", 80);

    iw.line();/*from w w w  .  j a  v a2  s . co  m*/

    assertEquals(expected.concat(LS), iw.toString());
}

From source file:dhbw.clippinggorilla.external.solr.SOLR.java

public static LinkedHashSet<Article> getArticlesFromSolr(Set<String> includedTagsSet,
        Set<String> excludedTagsSet, Map<Source, Boolean> sourcesMap, LocalDateTime date) {
    SolrQuery query = new SolrQuery();

    String include = "";
    String exclude;/*  w w w  .j  a  v  a2  s  .c o m*/
    String sources = "source:\"";

    List<String> includedTags = new ArrayList<>(includedTagsSet);
    if (includedTags.size() > 0) {
        include = "(" + replaceWhitespaces(includedTags.get(0), true) + ")";
        for (int i = 1; i < includedTags.size(); i++) {
            include += " OR " + "(" + replaceWhitespaces(includedTags.get(i), true) + ")";
        }
    }

    List<String> excludedTags = new ArrayList<>(excludedTagsSet);
    if (excludedTags.size() > 0) {
        exclude = "-(" + replaceWhitespaces(excludedTags.get(0), false) + ")";
        for (int i = 1; i < excludedTags.size(); i++) {
            exclude += " AND " + "-(" + replaceWhitespaces(excludedTags.get(i), false) + ")";
        }
        query.addFilterQuery(exclude);
    }

    for (Map.Entry<Source, Boolean> entry : sourcesMap.entrySet()) {
        if (entry.getValue()) {
            sources = sources.concat(entry.getKey().getId() + "\" OR \"");
        }
    }
    sources = sources.substring(0, sources.length() - 5);

    query.setQuery(include);
    query.set("qf", "title^3 description^2 body");
    query.addFilterQuery("publishedAt:[" + date.toString() + " TO NOW]");
    query.addFilterQuery(sources);

    if (client == null) {
        setServer();
    }

    try {
        QueryResponse queryResponse = client.query(query);
        List<Article> response = queryResponse.getBeans(Article.class);
        return new LinkedHashSet<>(response);
    } catch (SolrServerException | IOException e) {
        Log.error("Solr: Can't Query", e);
        return new LinkedHashSet<>();
    }
}

From source file:com.antonjohansson.svncommit.core.utils.Bash.java

/** {@inheritDoc} */
@Override//w ww  .j  a  v a2s. com
public File getTemporaryFile(Collection<String> lines, String prefix) {
    try {
        File temporaryFile = createTempFile("svn-commit-" + prefix + "-", ".tmp");
        for (String line : lines) {
            writeStringToFile(temporaryFile, line.concat(lineSeparator()), true);
        }
        return temporaryFile;
    } catch (IOException e) {
        throw new RuntimeException("Could not create temporary file", e);
    }
}

From source file:io.bitsquare.gui.components.paymentmethods.AliPayForm.java

@Override
protected void autoFillNameTextField() {
    if (useCustomAccountNameCheckBox != null && !useCustomAccountNameCheckBox.isSelected()) {
        String accountNr = accountNrInputTextField.getText();
        accountNr = StringUtils.abbreviate(accountNr, 9);
        String method = BSResources.get(paymentAccount.getPaymentMethod().getId());
        accountNameTextField.setText(method.concat(": ").concat(accountNr));
    }//  w w  w  .ja  va 2  s. co  m
}

From source file:controllerTas.actions.gnuplot.ThroughputPlotter.java

private String slashedPath(String s) {
    if (s.endsWith("/"))
        return s;
    return s.concat("/");
}

From source file:com.adobe.acs.commons.util.InfoWriterTest.java

@Test
public void testTitle_NoMessage() throws Exception {
    String expected = LS + StringUtils.repeat("-", 80);

    iw.title();/*  w w  w  .  j a v a  2 s .  com*/

    assertEquals(expected.concat(LS), iw.toString());
}

From source file:com.netflix.spinnaker.clouddriver.artifacts.helm.IndexParser.java

private String resolveReferenceUrl(String ref) {
    String resolvedRef = ref;//from  w  w w. j a v a 2 s.  co  m
    String base = repository;
    if (!base.endsWith("/")) {
        base = base.concat("/");
    }
    try {
        URL baseUrl = new URL(base);
        URL resolvedUrl = new URL(baseUrl, ref);
        resolvedRef = resolvedUrl.toExternalForm();
    } catch (MalformedURLException e) {
        log.error("Failed to resolve reference url:" + ref, e);
    }
    return resolvedRef;
}

From source file:com.example.hbranciforte.trafficclient.History.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_history);
    DefaultHttpClient httpclient = new DefaultHttpClient();
    TelephonyManager telephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
    String token = telephonyManager.getDeviceId().toString();
    //HttpPost httppostreq = new HttpPost("http://10.0.2.2:3000/parkings??notification_token=".concat(token));
    ListView listView = (ListView) findViewById(R.id.historyable);

    try {/*from   w  ww. j  a  v a 2 s .c o m*/
        HttpClient client = new DefaultHttpClient();
        String getURL = "http://45.55.79.197/parkings?notification_token=".concat(token);
        //String getURL = "http://10.0.2.2:3000/parkings?notification_token=".concat(token);
        HttpGet get = new HttpGet(getURL);
        HttpResponse responseGet = client.execute(get);
        HttpEntity resEntityGet = responseGet.getEntity();
        if (resEntityGet != null) {
            String response = EntityUtils.toString(resEntityGet);
            data = new JSONArray(response);

            String[] values = new String[data.length()];
            for (int i = 0; i < this.data.length(); i++) {
                JSONObject parking = new JSONObject(data.get(i).toString());
                JSONObject zone = new JSONObject(parking.getString("zone"));
                JSONObject car = new JSONObject(parking.getString("car"));
                String temp = "Patente: ".concat(car.getString("license_plate")).concat("\n");
                temp = temp.concat("Zona: ").concat(zone.getString("name")).concat("-")
                        .concat(Integer.toString(zone.getInt("number")).concat("\n"));
                temp = temp.concat("Estado: ").concat(parking.getString("status")).concat("\n");
                values[i] = temp.concat("Valido hasta: ").concat(parking.getString("formated_expires_at"));

            }
            ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,
                    android.R.id.text1, values);
            listView.setAdapter(adapter);
        }
    } catch (Exception e) {
        Log.e("Error Parsing:", e.getMessage());
    }

}

From source file:org.n52.series.db.dao.DatasetDao.java

private String prepareForConcatenation(String alias) {
    return (alias == null || alias.isEmpty()) ? "" : alias.concat(".");
}

From source file:io.bitsquare.gui.components.paymentmethods.ChaseQuickPayForm.java

@Override
protected void autoFillNameTextField() {
    if (useCustomAccountNameCheckBox != null && !useCustomAccountNameCheckBox.isSelected()) {
        String mobileNr = mobileNrInputTextField.getText();
        mobileNr = StringUtils.abbreviate(mobileNr, 9);
        String method = BSResources.get(paymentAccount.getPaymentMethod().getId());
        accountNameTextField.setText(method.concat(": ").concat(mobileNr));
    }// w w  w .  j  a v  a  2  s  .c  om
}