/** * Converts a class name to a JLS style class name. * * @param className the class name * @return the converted name */ private static String toCanonicalName(String className) { className = StringUtils.deleteWhitespace(className); Validate.notNull(className, "className must not be null."); if (className.endsWith("[]")) { final StringBuilder classNameBuffer = new StringBuilder(); while (className.endsWith("[]")) { className = className.substring(0, className.length() - 2); classNameBuffer.append("["); } final String abbreviation = abbreviationMap.get(className); if (abbreviation != null) { classNameBuffer.append(abbreviation); } else { classNameBuffer.append("L").append(className).append(";"); } className = classNameBuffer.toString(); } return className; }
/** * @return the manufacturer of the device as set in #MANUFACTURER_PROPERTY, typically "unknown" for emulators */ public static String getManufacturer( IDevice device ) { return StringUtils.deleteWhitespace( device.getProperty( MANUFACTURER_PROPERTY ) ); }
/** * @return the model of the device as set in #MODEL_PROPERTY, typically "sdk" for emulators */ public static String getModel( IDevice device ) { return StringUtils.deleteWhitespace( device.getProperty( MODEL_PROPERTY ) ); }
className = StringUtils.deleteWhitespace(className); if (className == null) { return null;
public static void main(String[] args) throws NacosException { String expression = "CONSUMER.label.A=PROVIDER.label.A &CONSUMER.label.B=PROVIDER.label.B"; expression = StringUtils.deleteWhitespace(expression); System.out.println(ExpressionInterpreter.getTerms(expression)); System.out.println(LabelSelector.parseExpression(expression)); } }
private String domainName(){ return StringUtils.deleteWhitespace(name().toLowerCase().replaceAll(",", "").replaceAll("'", "")); }
final String nospaces = StringUtils.deleteWhitespace(connectString); final String hostPortPairs[] = StringUtils.split(nospaces, ",", 100); final List<String> cleanedEntries = new ArrayList<>(hostPortPairs.length);
/** * <p> * A lowercase username composed of the first_name and last_name joined with a '.'. Some examples are: * <ul> * <li>(template) {@link #firstName()}.{@link #lastName()}</li> * <li>jim.jones</li> * <li>jason.leigh</li> * <li>tracy.jordan</li> * </ul> * </p> * @return a random two part user name. * @see Name#firstName() * @see Name#lastName() */ public String username() { String username = StringUtils.join(new String[]{ firstName().replaceAll("'", "").toLowerCase(), ".", lastName().replaceAll("'", "").toLowerCase()} ); return StringUtils.deleteWhitespace(username); } }
@Test public void testDeleteWhitespace_String() { assertNull(StringUtils.deleteWhitespace(null)); assertEquals("", StringUtils.deleteWhitespace("")); assertEquals("", StringUtils.deleteWhitespace(" \u000C \t\t\u001F\n\n \u000B ")); assertEquals("", StringUtils.deleteWhitespace(StringUtilsTest.WHITESPACE)); assertEquals(StringUtilsTest.NON_WHITESPACE, StringUtils.deleteWhitespace(StringUtilsTest.NON_WHITESPACE)); // Note: u-2007 and u-000A both cause problems in the source code // it should ignore 2007 but delete 000A assertEquals("\u00A0\u202F", StringUtils.deleteWhitespace(" \u00A0 \t\t\n\n \u202F ")); assertEquals("\u00A0\u202F", StringUtils.deleteWhitespace("\u00A0\u202F")); assertEquals("test", StringUtils.deleteWhitespace("\u000Bt \t\n\u0009e\rs\n\n \tt")); }
expression = StringUtils.deleteWhitespace(expression);
private String removeWhitespaces(String pomAsString) { return normalizeSpace(deleteWhitespace(pomAsString)); }
private void initHllConfig(JobContext context) { String _hllColumns = PinotOutputFormat.getHllColumns(context); if (_hllColumns != null) { String[] hllColumns = StringUtils.split(StringUtils.deleteWhitespace(_hllColumns), ','); if (hllColumns.length != 0) { HllConfig hllConfig = new HllConfig(PinotOutputFormat.getHllSize(context)); hllConfig.setColumnsToDeriveHllFields(new HashSet<>(Arrays.asList(hllColumns))); hllConfig.setHllDeriveColumnSuffix(PinotOutputFormat.getHllSuffix(context)); _segmentConfig.setHllConfig(hllConfig); } } }
break; expression = StringUtils.deleteWhitespace(expression);
String[] hllColumns = StringUtils.split(StringUtils.deleteWhitespace(_hllColumns), ','); if (hllColumns.length != 0) { LOGGER.info("Derive HLL fields on columns: {} with size: {} and suffix: {}", Arrays.toString(hllColumns),
/** * Method used to the the card type with regex * * @param pCardNumber * card number * @return the type of the card using regex */ public static EmvCardScheme getCardTypeByCardNumber(final String pCardNumber) { EmvCardScheme ret = null; if (pCardNumber != null) { for (EmvCardScheme val : EmvCardScheme.values()) { if (val.pattern != null && val.pattern.matcher(StringUtils.deleteWhitespace(pCardNumber)).matches()) { ret = val; break; } } } return ret; }
/** * Get card type by AID * * @param pAid * card AID * @return CardType or null */ public static EmvCardScheme getCardTypeByAid(final String pAid) { EmvCardScheme ret = null; if (pAid != null) { String aid = StringUtils.deleteWhitespace(pAid); for (EmvCardScheme val : EmvCardScheme.values()) { for (String schemeAid : val.getAid()) { if (aid.startsWith(StringUtils.deleteWhitespace(schemeAid))) { ret = val; break; } } } } return ret; }
/** * Method used to find description from ATR * * @param pAtr * Card ATR * @return list of description */ @SuppressWarnings("unchecked") public static final Collection<String> getDescription(final String pAtr) { Collection<String> ret = null; if (StringUtils.isNotBlank(pAtr)) { String val = StringUtils.deleteWhitespace(pAtr); for (String key : MAP.keySet()) { if (val.matches("^" + key + "$")) { ret = (Collection<String>) MAP.get(key); break; } } } return ret; }
private MetricsInfo buildOpTotalCountMetricsInfo(Op op) { return Interns.info("op=" + StringUtils.deleteWhitespace(op.getOpType()) + ".TotalCount", "Total operation count"); }
/** * Method used to find ATR description from ATS (Answer to select) * * @param pAts * EMV card ATS * @return card description */ @SuppressWarnings("unchecked") public static final Collection<String> getDescriptionFromAts(final String pAts) { Collection<String> ret = null; if (StringUtils.isNotBlank(pAts)) { String val = StringUtils.deleteWhitespace(pAts); for (String key : MAP.keySet()) { if (key.contains(val)) { // TODO Fix this ret = (Collection<String>) MAP.get(key); break; } } } return ret; }
private MetricsInfo buildOpRecordMetricsInfo(Op op, User user) { return Interns.info("op=" + StringUtils.deleteWhitespace(op.getOpType()) + ".user=" + user.getUser() + ".count", "Total operations performed by user"); } }