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

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

Introduction

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

Prototype

public static String trimToEmpty(final String str) 

Source Link

Document

Removes control characters (char <= 32) from both ends of this String returning an empty String ("") if the String is empty ("") after the trim or if it is null .

Usage

From source file:com.creditcloud.payment.model.chinapnr.UserBindCardResponse.java

@Override
public String chkString() {
    StringBuilder sb = new StringBuilder(baseChkString());
    sb.append(StringUtils.trimToEmpty(getOpenAcctId())).append(StringUtils.trimToEmpty(getOpenBankId()))
            .append(StringUtils.trimToEmpty(getUsrCustId())).append(StringUtils.trimToEmpty(getTrxId()))
            .append(StringUtils.trimToEmpty(getBgRetUrl())).append(StringUtils.trimToEmpty(getMerPriv()));
    return sb.toString();
}

From source file:com.creditcloud.payment.model.chinapnr.UserBindCardRequest.java

@Override
public String chkString() {
    StringBuilder sb = new StringBuilder(baseChkString());
    sb.append(StringUtils.trimToEmpty(getUsrCustId())).append(StringUtils.trimToEmpty(getBgRetUrl()))
            .append(StringUtils.trimToEmpty(getMerPriv()));
    return sb.toString();
}

From source file:com.esri.geoportal.harvester.console.ConsoleBrokerDefinitionAdaptor.java

/**
 * Creates instance of the adaptor.//from  w w w  . ja va 2s.  com
 * @param def broker definition
 * @throws InvalidDefinitionException if invalid definition
 */
public ConsoleBrokerDefinitionAdaptor(EntityDefinition def) throws InvalidDefinitionException {
    super(def);
    if (StringUtils.trimToEmpty(def.getType()).isEmpty()) {
        def.setType(ConsoleConnector.TYPE);
    } else if (!ConsoleConnector.TYPE.equals(def.getType())) {
        throw new InvalidDefinitionException("Broker definition doesn't match");
    }
}

From source file:com.threewks.thundr.view.negotiating.ViewNegotiatorRegistryImpl.java

public static String normaliseContentType(String contentType) {
    contentType = StringUtils.lowerCase(StringUtils.trimToEmpty(contentType));
    return contentType;
}

From source file:ke.co.tawi.babblesms.server.beans.log.OutgoingLog.java

public void setMessagestatusuuid(String messagestatusuuid) {
    this.messagestatusuuid = StringUtils.trimToEmpty(messagestatusuuid);
}

From source file:com.creditcloud.payment.model.chinapnr.query.QueryTransDetailRequest.java

@Override
public String chkString() {
    StringBuilder sb = new StringBuilder();
    sb.append(StringUtils.trimToEmpty(getVersion()));
    sb.append(StringUtils.trimToEmpty(getCmdId().name()));
    sb.append(StringUtils.trimToEmpty(getMerCustId()));
    sb.append(StringUtils.trimToEmpty(getOrdId()));
    sb.append(StringUtils.trimToEmpty(getQueryTransType()));
    sb.append(StringUtils.trimToEmpty(getReqExt()));
    return sb.toString();
}

From source file:ke.co.tawi.babblesms.server.beans.contact.Email.java

/**
 * @param address
 */
public void setAddress(String address) {
    this.address = StringUtils.trimToEmpty(address);
}

From source file:ke.co.tawi.babblesms.server.beans.log.OutgoingGrouplog.java

/**
 * @param messagestatusUuid/*from  w  w  w . java  2s. co  m*/
 */
public void setMessagestatusUuid(String messagestatusUuid) {
    this.messagestatusUuid = StringUtils.trimToEmpty(messagestatusUuid);
}

From source file:ml.shifu.core.di.builtin.binning.MunroPatBinning.java

@Override
public void addData(String val) {
    String fval = StringUtils.trimToEmpty(val);
    try {/*from  w ww  . jav  a  2  s .c o m*/
        Double dval = Double.parseDouble(fval);
        estimator.add(dval);
    } catch (NumberFormatException e) {
        super.incInvalidValCnt();
    }
}

From source file:dicoogle.ua.dim.DIMGeneric.java

private static String toTrimmedString(Object o, boolean allowNull) {
    if (o == null)
        if (allowNull)
            return null;
        else/*from w  ww  .j  a v  a2s.  c o  m*/
            return "";

    if (allowNull)
        return StringUtils.trimToNull(o.toString());

    return StringUtils.trimToEmpty(o.toString());
}