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:org.n52.series.spi.search.SearchResult.java

public SearchResult(String id, String label, String baseUrl) {
    this.id = id;
    this.label = label;
    this.baseUrl = baseUrl != null && !baseUrl.endsWith("/") ? baseUrl.concat("/") : baseUrl;
}

From source file:org.n52.sos.soe.GetCapabilitiesValidationTest.java

@Test
public void validateCapabilities()
        throws ClientProtocolException, IOException, IllegalStateException, XmlException {
    String url = HttpUtil.resolveServiceURL();

    XmlObject xo = HttpUtil/*from w w  w  .j  a  v a  2 s.  c  om*/
            .executeGetAndParseAsXml(url.concat("GetCapabilities?service=SOS&request=GetCapabilities&f=xml"));

    Assert.assertTrue("Not a Capabilities doc:" + xo.getClass(), xo instanceof CapabilitiesDocument);

    /*
     * log the caps; provides git commit hash version and other valuable
     * info
     */
    logger.info(xo.toString());

    XMLBeansParser.registerLaxValidationCase(new LaxValidationCase() {

        public boolean shouldPass(XmlValidationError xve) {
            return xve.getExpectedQNames() != null && xve.getExpectedQNames().contains(FEATURE_QN);
        }

        public boolean shouldPass(XmlError validationError) {
            if (!(validationError instanceof XmlValidationError))
                return false;

            XmlValidationError xve = (XmlValidationError) validationError;
            return shouldPass(xve);
        }
    });

    validateXml(xo);

    CapabilitiesDocument caps = (CapabilitiesDocument) xo;

    validateOfferings(caps.getCapabilities().getContents().getContents().getOfferingArray());
}

From source file:com.octo.java.sql.exp.Exp.java

public Exp startWith(String value) throws QueryGrammarException {
    value = isEmpty(value) ? null : value.concat("%");
    return applyOperation(Operator.LIKE, value);
}

From source file:com.pinterest.secor.parser.ThriftMessageParser.java

public ThriftMessageParser(SecorConfig config)
        throws InstantiationException, IllegalAccessException, ClassNotFoundException {
    super(config);
    TProtocolFactory protocolFactory = null;
    String protocolName = mConfig.getThriftProtocolClass();

    if (StringUtils.isNotEmpty(protocolName)) {
        String factoryClassName = protocolName.concat("$Factory");
        protocolFactory = ((Class<? extends TProtocolFactory>) Class.forName(factoryClassName)).newInstance();
    } else//from   w ww.j  a v  a 2  s.  c om
        protocolFactory = new TBinaryProtocol.Factory();

    mDeserializer = new TDeserializer(protocolFactory);
    mThriftPath = new ThriftPath(mConfig.getMessageTimestampName(), (short) mConfig.getMessageTimestampId());
    mTimestampType = mConfig.getMessageTimestampType();
}

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

@Override
protected void autoFillNameTextField() {
    if (useCustomAccountNameCheckBox != null && !useCustomAccountNameCheckBox.isSelected()) {
        String postalAddress = postalAddressTextArea.getText();
        postalAddress = StringUtils.abbreviate(postalAddress, 9);
        String method = BSResources.get(paymentAccount.getPaymentMethod().getId());
        accountNameTextField.setText(method.concat(": ").concat(postalAddress));
    }/*from  w  ww. j  av a  2 s. c  o m*/
}

From source file:be.bittich.dynaorm.dialect.MySQLDialect.java

@Override
public String update(String tableName, List<String> columns, List<String> values, String condition) {
    List<String> replacementValues = new LinkedList();
    for (String column : columns) {
        column = String.format(QUOTES, column);
        replacementValues.add(column.concat(EQUALITY).concat(REPLACEMENT_VALUE));
    }/*from  w ww  .  ja va2 s  .c om*/
    String req = Joiner.on(",").join(replacementValues);
    return String.format(UPDATE, tableName, req, condition);
}

From source file:com.octo.java.sql.exp.Exp.java

public Exp contains(String value) throws QueryGrammarException {
    value = isEmpty(value) ? null : "%".concat(value.concat("%"));
    return applyOperation(Operator.LIKE, value);
}

From source file:com.addthis.hydra.task.output.DefaultOutputWrapperFactory.java

static String getFileName(String target, PartitionData partitionData, OutputStreamFlags outputFlags,
        int fileVersion) {
    // by convention the partition can never be greater than 999
    String result = target;/*w  w w .  j a  va 2 s .c  om*/
    if (outputFlags.isNoAppend() || (outputFlags.getMaxFileSize() > 0)) {

        String versionString = Integer.toString(fileVersion);
        checkArgument(versionString.length() <= partitionData.getPadTo(),
                "fileVersion (%s) cannot be longer than %s digits or else padding will loop; try {{PART:%s}}",
                fileVersion, partitionData.getPadTo(), versionString.length());
        String part = Strings.padleft(versionString, partitionData.getPadTo(), Strings.pad0);
        if (partitionData.getReplacementString() != null) {
            result = target.replace(partitionData.getReplacementString(), part);
        } else {
            result = target.concat("-").concat(part);
        }
        if (outputFlags.isCompress()) {
            if (outputFlags.getCompressType() == 0) {
                result = result.concat(".gz");
            } else if (outputFlags.getCompressType() == 1) {
                result = result.concat(".lzf");
            } else if (outputFlags.getCompressType() == 2) {
                result = result.concat(".snappy");
            } else if (outputFlags.getCompressType() == 3) {
                result = result.concat(".bz2");
            } else if (outputFlags.getCompressType() == 4) {
                result = result.concat(".lzma");
            } else {
                throw new RuntimeException("unexpected compressionType: " + outputFlags.getCompressType());
            }
        }
    }

    if (outputFlags.isCompress()) {
        if (outputFlags.getCompressType() == 0 && !result.endsWith(".gz")) {
            result = result.concat(".gz");
        } else if (outputFlags.getCompressType() == 1 && !result.endsWith(".lzf")) {
            result = result.concat(".zlf");
        } else if (outputFlags.getCompressType() == 2 && !result.endsWith(".snappy")) {
            result = result.concat(".snappy");
        } else if (outputFlags.getCompressType() == 3 && !result.endsWith(".bz2")) {
            result = result.concat(".bz2");
        } else if (outputFlags.getCompressType() == 4 && !result.endsWith(".lzma")) {
            result = result.concat(".lzma");
        }
    }
    log.debug("[file] compress={} compressType:{} na={} for {}", outputFlags.isCompress(),
            outputFlags.getCompressType(), outputFlags.isNoAppend(), result);
    return result;
}

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

@Test
public void testLine_WithIndent() throws Exception {
    String expected = StringUtils.repeat(" ", 10) + StringUtils.repeat("-", 70);

    iw.line(10);// w  ww.j a v a 2  s  . c  om

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

From source file:org.n52.sos.soe.DescribeSensorTest.java

@Test
public void validateDescribeSensor()
        throws ClientProtocolException, IllegalStateException, IOException, XmlException {
    String url = HttpUtil.resolveServiceURL();

    Configuration config = Configuration.instance();
    XmlObject xo = HttpUtil.executeGetAndParseAsXml(url.concat(String.format(
            "DescribeSensor?service=SOS&version=2.0.0&request=DescribeSensor&procedure=%s&procedureDescriptionFormat=http://www.opengis.net/sensorML/1.0.1&f=xml",
            config.getNetwork())));//w  w  w . j a  v  a2  s.c  o m

    Assert.assertTrue("Not a DescribeSensorResponse: " + xo.getClass(),
            xo instanceof DescribeSensorResponseDocument);

    validateXml(xo);

    DescribeSensorResponseDocument ds = (DescribeSensorResponseDocument) xo;
    SensorDescriptionType description = ds.getDescribeSensorResponse().getDescriptionArray()[0]
            .getSensorDescription();

    SensorMLDocument sml = SensorMLDocument.Factory.parse(description.getData().xmlText());

    logger.info("description is a SensorML 1.0.1 document: " + sml.getSensorML().getDomNode().getLocalName());

    validateXml(sml);

    Assert.assertTrue("No member System", sml.getSensorML().getMemberArray().length > 0);

    SystemDocument system = SystemDocument.Factory.parse(sml.getSensorML().getMemberArray(0).xmlText());
    validateXml(system);

    Assert.assertTrue("No components for this System!",
            system.getSystem().getComponents().getComponentList().getComponentArray().length > 0);
}