Example usage for org.apache.commons.lang3 StringUtils EMPTY

List of usage examples for org.apache.commons.lang3 StringUtils EMPTY

Introduction

In this page you can find the example usage for org.apache.commons.lang3 StringUtils EMPTY.

Prototype

String EMPTY

To view the source code for org.apache.commons.lang3 StringUtils EMPTY.

Click Source Link

Document

The empty String "" .

Usage

From source file:io.github.swagger2markup.spi.MarkupComponent.java

protected String literalText(MarkupDocBuilder markupDocBuilder, String text) {
    if (StringUtils.isBlank(text)) {
        return StringUtils.EMPTY;
    }//from  w ww. jav  a 2 s. c  o m
    return copyMarkupDocBuilder(markupDocBuilder).literalText(text).toString();
}

From source file:com.msopentech.odatajclient.engine.communication.ODataClientErrorException.java

/**
 * Constructor./*  www . j  a va2  s.  c o  m*/
 *
 * @param statusLine request status info.
 * @param error OData error to be wrapped.
 */
public ODataClientErrorException(final StatusLine statusLine, final ODataError error) {
    super((StringUtils.isBlank(error.getCode()) ? StringUtils.EMPTY : "(" + error.getCode() + ") ")
            + error.getMessageValue() + " [" + statusLine.toString() + "]");

    this.statusLine = statusLine;
    this.error = error;

    if (this.error.getInnerErrorType() != null && this.error.getInnerErrorMessage() != null) {
        final RuntimeException cause = new RuntimeException(
                this.error.getInnerErrorType() + ": " + this.error.getInnerErrorMessage());

        if (this.error.getInnerErrorStacktrace() != null) {
            List<String> stLines;
            try {
                stLines = IOUtils.readLines(new StringReader(this.error.getInnerErrorStacktrace()));
            } catch (IOException e) {
                stLines = Collections.<String>emptyList();
            }
            StackTraceElement[] stElements = new StackTraceElement[stLines.size()];
            for (int i = 0; i < stLines.size(); i++) {
                final String stLine = stLines.get(i).substring(stLines.get(i).indexOf("at ") + 3);
                final int lastDotPos = stLine.lastIndexOf('.');
                stElements[i] = new StackTraceElement(stLine.substring(0, lastDotPos),
                        stLine.substring(lastDotPos + 1), null, 0);
            }
            cause.setStackTrace(stElements);
        }

        initCause(cause);
    }
}

From source file:com.omnigon.aem.handlebars.helpers.StartsWithHelper.java

/**
 *
 * @param context contains comparable string param.
 * @param options contains handlebar's content and
 * prefix param./* ww  w. jav  a2  s  . c om*/
 * @return returns handlebar's content if comparable
 * string param starts with otherwise null.
 * @throws IOException
 */
@Override
public CharSequence apply(final Object context, final Options options) throws IOException {
    if (!isValidComparableStringParam(context) || !isValidPrefixParam(options)) {
        return StringUtils.EMPTY;
    }
    CharSequence comparableString = (CharSequence) context;
    CharSequence prefix = options.param(0);
    CharSequence content = StringUtils.EMPTY;
    if (StringUtils.startsWith(comparableString, prefix)) {
        content = options.fn();
    }
    return content;
}

From source file:com.gammalabs.wifianalyzer.wifi.band.WiFiChannelCountry.java

@NonNull
public String getCountryCode() {
    String countryCode = this.country.getCountry();
    if (countryCode == null) {
        countryCode = StringUtils.EMPTY;
    }//  w  w  w  . j a  va  2s  .c om
    return countryCode;
}

From source file:com.vrem.wifianalyzer.wifi.band.WiFiChannelCountry.java

@NonNull
public String getCountryCode() {
    String countryCode = country.getCountry();
    if (countryCode == null) {
        countryCode = StringUtils.EMPTY;
    }//from  w  ww .  j  a v  a2  s  . c  o m
    return countryCode;
}

From source file:com.googlecode.jsendnsca.utils.ByteArrayUtilsTest.java

@Test
public void shouldReturnByteArrayOf5InSizeIfPassedEmptyString() throws Exception {
    final byte[] actual = ByteArrayUtils.getFixedSizeBytes(5, StringUtils.EMPTY);

    assertTrue(actual.length == 5);/*w  ww . j a  va  2 s .  c  o m*/
}

From source file:com.github.fengtan.sophie.tables.CoresTable.java

/**
 * Get the currently selected core.//  w w w  .  j av a2s.c om
 * 
 * @return Currently selected core.
 */
public String getSelectedCore() {
    TableItem[] items = getTableSelection();
    // Core name is in the first column
    return (items.length > 0) ? items[0].getText(0) : StringUtils.EMPTY;
}

From source file:monasca.api.infrastructure.persistence.influxdb.InfluxV9UtilsTest.java

@Test(groups = { "functional", "timeOffsetPart" })
public void testTimeOffsetPart_NullString() throws Exception {
    assertEquals(StringUtils.EMPTY, this.instance.timeOffsetPart(null));
}

From source file:me.j360.dubbo.modules.util.concurrent.ThreadUtil.java

/**
 * StackTrace?"??.??()"//from   w  w w  . j a v a 2  s .c o  m
 */
public static String getCurrentMethod() {
    StackTraceElement[] stacktrace = Thread.currentThread().getStackTrace();
    if (stacktrace.length >= 3) {
        StackTraceElement element = stacktrace[2];
        return element.getClassName() + '.' + element.getMethodName() + "()";
    } else {
        return StringUtils.EMPTY;
    }
}

From source file:eu.operando.operandoapp.wifi.model.WiFiData.java

@NonNull
public WiFiDetail getConnection() {
    for (WiFiDetail wiFiDetail : wiFiDetails) {
        if (wiFiConnection.equals(new WiFiConnection(wiFiDetail.getSSID(), wiFiDetail.getBSSID()))) {
            String vendorName = StringUtils.EMPTY;
            WifiConfiguration wifiConfiguration = getConfigurationForWiFiDetail(wiFiDetail);

            WiFiAdditional wiFiAdditional = new WiFiAdditional(vendorName, wiFiConnection.getIpAddress(),
                    wiFiConnection.getLinkSpeed(), wifiConfiguration);
            return new WiFiDetail(wiFiDetail, wiFiAdditional);
        }//from  ww  w  .j  a  va 2s .  c  o m
    }
    return WiFiDetail.EMPTY;
}