Example usage for org.apache.commons.lang StringUtils isEmpty

List of usage examples for org.apache.commons.lang StringUtils isEmpty

Introduction

In this page you can find the example usage for org.apache.commons.lang StringUtils isEmpty.

Prototype

public static boolean isEmpty(String str) 

Source Link

Document

Checks if a String is empty ("") or null.

Usage

From source file:com.bstek.dorado.data.type.FloatDataType.java

public Object fromText(String text) {
    if (StringUtils.isEmpty(text)) {
        return null;
    } else {/*from  ww w .  j  a  v  a 2s  .c  om*/
        return Float.valueOf(text);
    }
}

From source file:gov.nih.nci.cabig.caaers.domain.workflow.ReviewCommentTest.java

public void testGetFullComment() {
    assertTrue(StringUtils.isEmpty(comment.getFullComment()));
    comment.setAutoGeneratedText("Hello");
    assertEquals("Hello", comment.getFullComment());
    comment.setAutoGeneratedText(null);//from ww w.  ja  va 2  s .  c  o  m
    assertTrue(StringUtils.isEmpty(comment.getFullComment()));
    comment.setUserComment("World");
    System.out.println(comment.getFullComment());
    assertEquals(" : World", comment.getFullComment());

    comment.setAutoGeneratedText("Hello");
    assertEquals("Hello : World", comment.getFullComment());
}

From source file:com.bstek.dorado.data.type.DoubleDataType.java

public Object fromText(String text) {
    if (StringUtils.isEmpty(text)) {
        return null;
    } else {/*from w  w w. ja v a 2 s.  com*/
        return Double.valueOf(text);
    }
}

From source file:com.mengka.diamond.manager.impl.ConfigInfoListener.java

public void receiveConfigInfo(String configInfo) {
    if (StringUtils.isEmpty(configInfo)) {
        log.warn("??");
        return;/*from ww  w  .j  a  va 2s .com*/
    }

    try {
        innerReceive(configInfo);
    } catch (Exception e) {
        log.warn("configInfo" + configInfo, e);
    }

}

From source file:com.bstek.dorado.data.type.PrimitiveFloatDataType.java

@Override
public Object fromText(String text) {
    if (StringUtils.isEmpty(text)) {
        return new Float(0);
    }/*ww  w .  java2  s  . c o  m*/
    return super.fromText(text);
}

From source file:com.bstek.dorado.data.type.PrimitiveDoubleDataType.java

@Override
public Object fromText(String text) {
    if (StringUtils.isEmpty(text)) {
        return new Double(0);
    }//from  w w w  .j ava  2s  .  com
    return super.fromText(text);
}

From source file:converters.StringToAuthorityConverter.java

@Override
public Authority convert(String text) {
    Authority result;/*  w  w w .  j  a v  a 2 s .  c om*/
    try {
        if (StringUtils.isEmpty(text))
            result = null;
        else {
            result = new Authority();
            result.setAuthority(text);

        }
    } catch (Throwable oops) {
        throw new IllegalArgumentException(oops);
    }

    return result;
}

From source file:com.abiquo.server.core.infrastructure.RemoteServiceDAO.java

private static Criterion equalUri(final String uri) {
    assert !StringUtils.isEmpty(uri);

    return Restrictions.eq(RemoteService.URI_PROPERTY, uri);
}

From source file:base.UnitTestBase.java

@Before
public void before() {
    if (StringUtils.isEmpty(springXmlpath)) {
        springXmlpath = "classpath:/springConfig/applicationContext.xml";
    }//from ww w  .ja va 2 s . c o  m
    try {
        context = new ClassPathXmlApplicationContext(springXmlpath.split("[,\\s]+"));
        context.start();
    } catch (BeansException e) {
        e.printStackTrace();
    }
}

From source file:com.googlecode.jtiger.modules.ecside.core.bean.RowDefaults.java

static String getSelectlightClass(TableModel model, String selectlightClass) {
    if (StringUtils.isEmpty(selectlightClass)) {
        return model.getPreferences().getPreference(PreferencesConstants.ROW_SELECTLIGHT_CLASS);
    }//from   w w  w  .j a  v a  2 s.c  o m

    return selectlightClass;
}