List of usage examples for org.apache.commons.lang3 StringUtils EMPTY
String EMPTY
To view the source code for org.apache.commons.lang3 StringUtils EMPTY.
Click Source Link
From source file:com.ts.db.connector.ConnectorMap.java
private void copyPropertyById(String id, String key, Properties src, Properties dst) { String fullKey = id + '.' + key; String value = src.getProperty(fullKey, StringUtils.EMPTY); dst.setProperty(key, value);/* w w w . j a v a 2s.c o m*/ }
From source file:de.blizzy.documentr.validation.ProjectExistsValidatorTest.java
@Test public void isValid() { when(repoManager.listProjects()).thenReturn(Lists.newArrayList("project")); //$NON-NLS-1$ assertTrue(validator.isValid(null, null)); assertTrue(validator.isValid(StringUtils.EMPTY, null)); assertTrue(validator.isValid("project", null)); //$NON-NLS-1$ assertFalse(validator.isValid("project2", null)); //$NON-NLS-1$ }
From source file:fakedatamaker.location.us.FakeUSAddress.java
/** * //w ww .j ava 2 s . c om * @param streetNumber * @param streetName * @param usStreetType * @param city * @param usState * @param postalCode * @throws FakeAddressException */ public FakeUSAddress(String streetNumber, String streetName, USStreetType usStreetType, String city, USState usState, String postalCode) throws FakeAddressException { this(streetNumber, streetName, usStreetType, StringUtils.EMPTY, city, usState, postalCode, true, true); }
From source file:cop.raml.utils.Utils.java
public static String join(String lhs, String rhs) { lhs = StringUtils.isBlank(lhs) ? StringUtils.EMPTY : lhs.trim(); rhs = StringUtils.isBlank(rhs) ? StringUtils.EMPTY : rhs.trim(); lhs = removeTrailingSlashes(lhs);//from w w w.ja v a 2s . com rhs = removeLeadingSlashes(rhs); rhs = removeTrailingSlashes(rhs); if (rhs.isEmpty()) return lhs.isEmpty() ? null : lhs; return lhs.isEmpty() ? rhs : String.format("%s/%s", lhs, rhs); }
From source file:com.shenit.commons.utils.ShortLinkUtils.java
/** * Shorten url/*from ww w . j a va 2 s . c o m*/ * @param url URL that not encoded * @param query * @return */ public static String shorten(String url, String query, Object salt) { if (StringUtils.isEmpty(url)) return null; String joinStr = url.indexOf(HttpUtils.QUERY_CHAR) > 0 ? HttpUtils.QUERY_CHAR : HttpUtils.AMP; final String queryParams = (query != null) ? joinStr + query : StringUtils.EMPTY; String saltStr = DataUtils.toString(salt, StringUtils.EMPTY); url = toUrl((url + queryParams)); return StringUtils.isEmpty(url) ? null : Hashing.murmur3_32().hashString(url + HttpUtils.HASH_CHAR + saltStr, StandardCharsets.UTF_8) .toString(); }
From source file:de.blizzy.documentr.validation.ProjectDoesNotExistValidatorTest.java
@Test public void isValid() { when(repoManager.listProjects()).thenReturn(Lists.newArrayList("project")); //$NON-NLS-1$ assertTrue(validator.isValid(null, null)); assertTrue(validator.isValid(StringUtils.EMPTY, null)); assertTrue(validator.isValid("project2", null)); //$NON-NLS-1$ assertFalse(validator.isValid("project", null)); //$NON-NLS-1$ }
From source file:de.blizzy.documentr.validation.RoleExistsValidatorTest.java
@Test public void isValid() throws IOException { when(userStore.getRole("role")).thenReturn(role); //$NON-NLS-1$ assertTrue(validator.isValid(null, null)); assertTrue(validator.isValid(StringUtils.EMPTY, null)); assertTrue(validator.isValid("role", null)); //$NON-NLS-1$ assertFalse(validator.isValid("role2", null)); //$NON-NLS-1$ }
From source file:com.yqboots.initializer.core.ProjectMetadata.java
public String getDescription() { return StringUtils.defaultIfEmpty(this.description, StringUtils.EMPTY); }
From source file:com.aqnote.app.wifianalyzer.vendor.model.VendorNameUtilsTest.java
@Test public void testCleanVendorNameAsHTML() throws Exception { // execute & validate assertEquals(StringUtils.EMPTY, VendorNameUtils.cleanVendorName("X < Y Z")); assertEquals(StringUtils.EMPTY, VendorNameUtils.cleanVendorName("X Y > Z")); }
From source file:com.github.haixing_hu.ilibrary.model.FieldTemplateBuilder.java
public FieldTemplateBuilder reset() { name = StringUtils.EMPTY; type = DataType.STRING; multiple = false; return this; }