List of usage examples for org.apache.commons.lang3 StringUtils trimToEmpty
public static String trimToEmpty(final String str)
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 .
From source file:com.creditcloud.payment.model.chinapnr.UserFreezeResponse.java
@Override public String chkString() { StringBuilder sb = new StringBuilder(baseChkString()); sb.append(StringUtils.trimToEmpty(getSubAcctType())).append(StringUtils.trimToEmpty(getSubAcctId())) .append(StringUtils.trimToEmpty(getOrdId())).append(StringUtils.trimToEmpty(getOrdDate())) .append(StringUtils.trimToEmpty(getTransAmt())).append(StringUtils.trimToEmpty(getRetUrl())) .append(StringUtils.trimToEmpty(getBgRetUrl())).append(StringUtils.trimToEmpty(getTrxId())) .append(StringUtils.trimToEmpty(getMerPriv())); return sb.toString(); }
From source file:com.omertron.subbabaapi.model.SubBabaFileInfo.java
public void setFileSize(String fileSize) { this.fileSize = StringUtils.trimToEmpty(fileSize); }
From source file:com.esri.geoportal.harvester.sink.SinkBrokerDefinitionAdaptor.java
/** * Creates instance of the adaptor.//from ww w. jav a 2 s .c o m * @param def broker definition * @throws InvalidDefinitionException if invalid broker definition */ public SinkBrokerDefinitionAdaptor(EntityDefinition def) throws InvalidDefinitionException { super(def); if (StringUtils.trimToEmpty(def.getType()).isEmpty()) { def.setType(SinkConnector.TYPE); } else if (!SinkConnector.TYPE.equals(def.getType())) { throw new InvalidDefinitionException("Broker definition doesn't match"); } else { try { dropFolder = new File(get(P_DROP_FOLDER)); } catch (Exception ex) { throw new InvalidDefinitionException( String.format("Invalid %s: %s", P_DROP_FOLDER, get(P_DROP_FOLDER)), ex); } } }
From source file:com.callidusrobotics.droptables.configuration.LoginInfo.java
@JsonProperty public void setUsername(String username) { this.username = StringUtils.trimToEmpty(username); }
From source file:com.creditcloud.payment.model.chinapnr.transfer.AddBidInfoResponse.java
@Override public String chkString() { StringBuilder sb = new StringBuilder(baseChkString()); sb.append(StringUtils.trimToEmpty(this.getProId())).append(StringUtils.trimToEmpty(this.getBorrCustId())) .append(StringUtils.trimToEmpty(this.getBorrTotAmt())) .append(StringUtils.trimToEmpty(this.getGuarCompId())) .append(StringUtils.trimToEmpty(this.getGuarAmt())) .append(StringUtils.trimToEmpty(this.getProArea())) .append(StringUtils.trimToEmpty(this.getBgRetUrl())) .append(StringUtils.trimToEmpty(this.getMerPriv())) .append(StringUtils.trimToEmpty(this.getRespExt())); return sb.toString(); }
From source file:ke.co.tawi.babblesms.server.beans.contact.Phone.java
public void setPhonenumber(String phonenumber) { this.phoneNumber = StringUtils.trimToEmpty(phonenumber); }
From source file:com.threewks.thundr.view.negotiating.strategy.FileExtensionNegotiationStrategy.java
@Override public Negotiator<?> findNegotiator(HttpServletRequest req, NegotiatingView view, ViewNegotiatorRegistry viewNegotiatorRegistry) { String requestUri = req.getRequestURI(); String extension = StringUtils.trimToEmpty(StringUtils.substringAfterLast(requestUri, ".")); String mimeType = MimeTypes.lookupMimeType(extension); return viewNegotiatorRegistry.getNegotiator(mimeType); }
From source file:com.threewks.thundr.route.rewrite.Rewrite.java
public String getRewriteTo(Map<String, String> pathVars) { String finalRewrite = rewriteTo; Matcher matcher = Route.PathParameterPattern.matcher(rewriteTo); while (matcher.find()) { String token = matcher.group(1); finalRewrite = finalRewrite.replaceAll(Pattern.quote("{" + token + "}"), Matcher.quoteReplacement(StringUtils.trimToEmpty(pathVars.get(token)))); }/* www . j av a 2 s . com*/ return finalRewrite; }
From source file:com.esri.geoportal.harvester.unc.UncBrokerDefinitionAdaptor.java
/** * Creates instance of the adaptor.//from www . jav a2 s .c o m * @param def broker definition * @throws InvalidDefinitionException if invalid broker definition */ public UncBrokerDefinitionAdaptor(EntityDefinition def) throws InvalidDefinitionException { super(def); if (StringUtils.trimToEmpty(def.getType()).isEmpty()) { def.setType(UncConnector.TYPE); } else if (!UncConnector.TYPE.equals(def.getType())) { throw new InvalidDefinitionException("Broker definition doesn't match"); } else { try { rootFolder = new File(get(P_ROOT_FOLDER)); } catch (Exception ex) { throw new InvalidDefinitionException( String.format("Invalid %s: %s", P_ROOT_FOLDER, get(P_ROOT_FOLDER)), ex); } pattern = get(P_PATTERN); } }
From source file:com.threewks.thundr.transformer.discrete.ObjectToEnum.java
@SuppressWarnings("unchecked") @Override//from w w w .j a va 2 s.c om public E from(From from) { if (from == null) { return null; } String fromString = StringUtils.trimToEmpty(StringUtils.lowerCase(from.toString())); Map<String, Object> cache = enumValueCache.get(type); return (E) cache.get(fromString); }