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:ke.co.tawi.babblesms.server.beans.contact.Phone.java
public void setStatusuuid(String statusuuid) { this.statusUuid = StringUtils.trimToEmpty(statusuuid); }
From source file:com.webbfontaine.valuewebb.action.pricedb.mp.MPFillUtils.java
private static void setValuesForVM(MarketPrice mp) { String vmCode = StringUtils.trimToEmpty(mp.getVmRuleCode()); mp.setRetailerPriceCur(null);/* w ww.j a v a 2 s .co m*/ switch (vmCode) { case "4": mp.setFob(null); mp.setFobUSD(null); mp.setRetailerPriceCur(Utils.getNationalCurrencyName()); mp.setRetailPriceCurExcRate(BigDecimal.ONE); break; case "6": case "V": mp.setRetailerPrice(null); mp.setRetailerRate(null); clearCalculableFields(mp); break; case "X": mp.setRetailerPriceUsd(null); mp.setRetailerRate(null); mp.setFobUSD(null); clearCalculableFields(mp); break; default: LOGGER.debug("VM is unknown or not set {}", vmCode); } }
From source file:com.mirth.connect.plugins.httpauth.AuthenticationResult.java
public void setUsername(String username) { this.username = StringUtils.trimToEmpty(username); }
From source file:kenh.xscript.elements.Print.java
public void process(@Attribute(ATTRIBUTE_TRIM) boolean trim) throws UnsupportedScriptException { Object text = this.getParsedText(); if (text instanceof String) { print(StringUtils.trimToEmpty((String) text)); }//ww w .j a v a 2 s . c o m print(text); }
From source file:com.omertron.subbabaapi.model.SubBabaMovie.java
public void setImdbId(String imdbId) { this.imdbId = StringUtils.trimToEmpty(imdbId); }
From source file:com.esri.geoportal.harvester.agp.AgpOutputBrokerDefinitionAdaptor.java
/** * Creates instance of the adaptor./*from www . ja v a 2s . com*/ * @param def broker definition * @throws IllegalArgumentException if invalid broker definition */ public AgpOutputBrokerDefinitionAdaptor(EntityDefinition def) throws InvalidDefinitionException { super(def); this.credAdaptor = new CredentialsDefinitionAdaptor(def); if (StringUtils.trimToEmpty(def.getType()).isEmpty()) { def.setType(AgpOutputConnector.TYPE); } else if (!AgpOutputConnector.TYPE.equals(def.getType())) { throw new InvalidDefinitionException("Broker definition doesn't match"); } else { try { hostUrl = new URL(get(P_HOST_URL)); } catch (MalformedURLException ex) { throw new InvalidDefinitionException(String.format("Invalid %s: %s", P_HOST_URL, get(P_HOST_URL)), ex); } folderId = get(P_FOLDER_ID); cleanup = Boolean.parseBoolean(get(P_FOLDER_CLEANUP)); } }
From source file:ke.co.tawi.babblesms.server.beans.contact.Email.java
/** * @param statusuuid */ public void setStatusuuid(String statusuuid) { this.statusUuid = StringUtils.trimToEmpty(statusuuid); }
From source file:kenh.xscript.elements.Println.java
public void process(@Attribute(ATTRIBUTE_TRIM) boolean trim) throws UnsupportedScriptException { Object text = this.getParsedText(); if (text instanceof String) { println(StringUtils.trimToEmpty((String) text)); }// w w w . ja v a 2 s .com println(text); }
From source file:ke.co.tawi.babblesms.server.beans.account.Account.java
/** * * @param username */ public void setUsername(String username) { this.username = StringUtils.trimToEmpty(username); }
From source file:com.esri.geoportal.harvester.ckan.CkanBrokerDefinitionAdaptor.java
/** * Creates instance of the adaptor.//w w w . ja v a2 s . c o m * @param def broker definition * @throws InvalidDefinitionException if definition is invalid * @throws IllegalArgumentException if invalid broker definition */ public CkanBrokerDefinitionAdaptor(EntityDefinition def) throws InvalidDefinitionException { super(def); this.botsAdaptor = new BotsBrokerDefinitionAdaptor(def); if (StringUtils.trimToEmpty(def.getType()).isEmpty()) { def.setType(CkanConnector.TYPE); } else if (!getType().equals(def.getType())) { throw new InvalidDefinitionException("Broker definition doesn't match"); } else { initialize(def); } }