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

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

Introduction

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

Prototype

String SPACE

To view the source code for org.apache.commons.lang3 StringUtils SPACE.

Click Source Link

Document

A String for a space character.

Usage

From source file:org.openecomp.sdc.ci.tests.execute.service.UpdateServiceMetadataTest.java

@Test
public void iconValidationTest11() throws Exception {
    updatedServiceDetails.setIcon(StringUtils.SPACE); // one space with
    // nothing/*from   w w  w . ja  v a 2 s . c o  m*/
    updateWithInvalidValue(ActionStatus.COMPONENT_MISSING_ICON, new ArrayList<>(Arrays.asList("Service")));
}

From source file:org.openestate.io.core.NumberUtils.java

/**
 * Convert a string value into a number.
 *
 * @param value//from  w ww.  j  a v a2  s .  c o m
 * the string value to convert
 *
 * @param integerOnly
 * wether only the integer part of the value is parsed
 *
 * @param locales
 * locales, against which the value is parsed
 *
 * @return
 * numeric value for the string
 *
 * @throws NumberFormatException
 * if the string is not a valid number
 */
public static Number parseNumber(String value, boolean integerOnly, Locale... locales)
        throws NumberFormatException {
    value = StringUtils.trimToNull(value);
    if (value == null)
        return null;

    // ignore leading plus sign
    if (value.startsWith("+"))
        value = StringUtils.trimToNull(value.substring(1));

    // remove any spaces
    value = StringUtils.replace(value, StringUtils.SPACE, StringUtils.EMPTY);

    if (ArrayUtils.isEmpty(locales))
        locales = new Locale[] { Locale.getDefault() };

    for (Locale locale : locales) {
        // check, if the value is completely numeric for the locale
        if (!isNumeric(value, locale))
            continue;
        try {
            NumberFormat format = NumberFormat.getNumberInstance(locale);
            format.setMinimumFractionDigits(0);
            format.setGroupingUsed(false);
            format.setParseIntegerOnly(integerOnly);
            return format.parse(value);
        } catch (ParseException ex) {
        }
    }
    throw new NumberFormatException("The provided value '" + value + "' is not numeric!");
}

From source file:org.opensingular.lib.wicket.util.bootstrap.layout.BSWellBorder.java

private WebMarkupContainer buildWell(String sizeClass) {
    return new WebMarkupContainer("well") {
        @Override/*w w w. j a  v  a 2s .  c  o  m*/
        protected void onInitialize() {
            super.onInitialize();
            add($b.attrAppender("style", sizeClass, StringUtils.SPACE));
        }
    };
}

From source file:rus.cpuinfo.AndroidDepedentModel.SysInfo.java

@NonNull
private String getJavaVM() {
    String vmName = System.getProperty("java.vm.name");
    String vmVersion = System.getProperty("java.vm.version");

    return vmName != null && vmVersion != null ? vmName + StringUtils.SPACE + vmVersion : StringUtils.EMPTY;

}