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

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

Introduction

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

Prototype

public static boolean isNotEmpty(final CharSequence cs) 

Source Link

Document

Checks if a CharSequence is not empty ("") and not null.

 StringUtils.isNotEmpty(null)      = false StringUtils.isNotEmpty("")        = false StringUtils.isNotEmpty(" ")       = true StringUtils.isNotEmpty("bob")     = true StringUtils.isNotEmpty("  bob  ") = true 

Usage

From source file:com.msg.wmTestHelper.pojo.GeneratorParameter.java

public boolean hasSufficientData() {
    return StringUtils.isNotEmpty(wmprtPath) //
            && outputPath != null //
            && StringUtils.isNotEmpty(baseNamespace);
}

From source file:com.creditcloud.investmentfund.model.lion.response.BaseResponse.java

/**
 * ??/*from  w w  w  .ja  va2s. c  o m*/
 * 
 * @return 
 */
public boolean success() {
    if (StringUtils.isNotEmpty(returncode)) {
        return returncode.contentEquals(FundConstant.SUCCESS_CODE);
    } else {
        return false;
    }
}

From source file:com.haulmont.cuba.gui.xml.layout.loaders.OptionsGroupLoader.java

@Override
public void loadComponent() {
    super.loadComponent();

    String multiselect = element.attributeValue("multiselect");
    if (StringUtils.isNotEmpty(multiselect)) {
        resultComponent.setMultiSelect(Boolean.parseBoolean(multiselect));
    }/*  w w w. ja v a2s. c o  m*/

    loadOrientation(resultComponent, element);
    loadCaptionProperty(resultComponent, element);

    loadOptionsEnum(resultComponent, element);
    loadTabIndex(resultComponent, element);
}

From source file:com.glaf.jbpm.factory.JbpmActionHandlerFactory.java

public static void execute(String key, ExecutionContext executionContext) {
    String actionHandlerExecution = "spring";
    if (StringUtils.isNotEmpty(SystemProperties.getString(JBPM_ACTION_HANDLER_FACTORY_TYPE))) {
        actionHandlerExecution = SystemProperties.getString(JBPM_ACTION_HANDLER_FACTORY_TYPE);
    }//from  w  ww .j a va  2 s  . c  om
    if (StringUtils.isNotEmpty(CustomProperties.getString(JBPM_ACTION_HANDLER_FACTORY_TYPE))) {
        actionHandlerExecution = CustomProperties.getString(JBPM_ACTION_HANDLER_FACTORY_TYPE);
    }

    key = key.trim();

    ActionHandler actionHandler = null;
    if (StringUtils.equals(actionHandlerExecution, "spring")) {
        actionHandler = (ActionHandler) JbpmActionHandlerBeanFactory.getBean(key);
        if (actionHandler != null) {
            try {
                actionHandler.execute(executionContext);
            } catch (Exception ex) {
                throw new JbpmException(ex);
            }
        }
    } else {
        try {
            actionHandler = (ActionHandler) pool.borrowObject(key);
            if (actionHandler != null) {
                actionHandler.execute(executionContext);
            }
        } catch (Exception ex) {
            throw new JbpmException(ex);
        } finally {
            if (actionHandler != null) {
                try {
                    pool.returnObject(key, actionHandler);
                } catch (Exception ex) {
                    if (LogUtils.isDebug()) {
                        ex.printStackTrace();
                    }
                }
            }
        }
    }
}

From source file:com.github.tomakehurst.wiremock.extension.responsetemplating.UrlPath.java

public UrlPath(String url) {
    originalPath = URI.create(url).getPath();
    Iterable<String> pathNodes = Splitter.on('/').split(originalPath);
    for (String pathNode : pathNodes) {
        if (StringUtils.isNotEmpty(pathNode)) {
            add(pathNode);/*from   ww  w  . j a v a2 s  .co  m*/
        }
    }
}

From source file:com.pontorural.pedidovenda.converter.TabelaConverter.java

@Override
public Object getAsObject(FacesContext context, UIComponent component, String value) {
    Tabela retorno = null;/* ww w . j  a va2  s . c  om*/

    if (StringUtils.isNotEmpty(value)) {
        Integer codigo = new Integer(value);
        retorno = tabelas.porId(codigo);
    }

    return retorno;
}

From source file:de.micromata.genome.gwiki.plugin.blog_1_0.GWikiBlogEntryAction.java

public boolean init() {
    blogPageId = wikiContext.getCurrentElement().getElementInfo().getParentId();
    if (StringUtils.isNotEmpty(blogPageId) == true) {
        blogPage = wikiContext.getWikiWeb().findElementInfo(blogPageId);
    }//  w  ww. j  ava2 s. co m
    return super.init();
}

From source file:com.glaf.jbpm.util.SqlParamUtils.java

@SuppressWarnings("unchecked")
public static List<Object> getValues(Map<String, Object> paramMap, SqlExecutor executor) {
    java.util.Date now = new java.util.Date();
    List<Object> values = new java.util.ArrayList<Object>();
    Object parameter = executor.getParameter();
    if (parameter instanceof Map) {
        Map<String, Object> params = (Map<String, Object>) parameter;
        Set<Entry<String, Object>> entrySet = params.entrySet();
        for (Entry<String, Object> entry : entrySet) {
            String key = entry.getKey();
            Object value = entry.getValue();
            if (key != null && value != null) {
                if (value instanceof String) {
                    String tmp = (String) value;
                    if (StringUtils.isNotEmpty(tmp)) {
                        if (tmp.equals("now()")) {
                            value = new java.sql.Date(now.getTime());
                        } else if (tmp.equals("date()")) {
                            value = new java.sql.Date(now.getTime());
                        } else if (tmp.equals("time()")) {
                            value = new java.sql.Time(now.getTime());
                        } else if (tmp.equals("timestamp()")) {
                            value = new java.sql.Timestamp(now.getTime());
                        } else if (tmp.equals("dateTime()")) {
                            value = new java.sql.Timestamp(now.getTime());
                        } else if (tmp.equals("currentTimeMillis()")) {
                            value = Long.valueOf(System.currentTimeMillis());
                        } else if (tmp.equals("#{rowId}")) {
                            value = paramMap.get("rowId");
                        } else if (tmp.equals("#{processInstanceId}")) {
                            value = ParamUtils.getString(paramMap, "processInstanceId");
                        } else if (tmp.equals("#{processName}")) {
                            value = ParamUtils.getString(paramMap, "processName");
                        } else if (tmp.equals("#{status}")) {
                            value = paramMap.get("status");
                        } else if (tmp.startsWith("#P{") && tmp.endsWith("}")) {
                            tmp = StringTools.replaceIgnoreCase(tmp, "#P{", "");
                            tmp = StringTools.replaceIgnoreCase(tmp, "}", "");
                            value = paramMap.get(tmp);
                        } else if (tmp.startsWith("#{") && tmp.endsWith("}")) {
                            value = DefaultExpressionEvaluator.evaluate(tmp, paramMap);
                        }//ww w  . j a  v  a  2 s  .  c  o  m
                    }
                }
            }
            values.add(value);
        }
    }

    return values;
}

From source file:com.gdo.stencils.cond.LinkCondition.java

/**
 * Tests if a condition is to retrieve the adaptor directly.
 *///w  ww . j a  v  a 2 s. c  om
public static <C extends _StencilContext, S extends _PStencil<C, S>> boolean isWithLinksCondition(C stclContext,
        S link, StencilCondition<C, S> cond) {
    if (cond instanceof PathCondition) {
        String path = ((PathCondition<C, S>) cond).getCondition();
        if (PathUtils.isKeyContained(path)) {
            String key = PathUtils.getKeyContained(path);
            if (StringUtils.isNotEmpty(key) && key.startsWith("$")) {
                String c = key.substring(1);
                if (StringUtils.isEmpty(c))
                    return true;
                PathCondition<C, S> p = PathCondition.newKeyCondition(stclContext, new Key(c), link);
                return p.verify(stclContext, link);
            }
        } else if (PathUtils.isExpContained(path)) {
            String exp = PathUtils.getExpContained(path);
            if (StringUtils.isNotEmpty(exp) && exp.startsWith("$")) {
                String c = exp.substring(1);
                if (StringUtils.isEmpty(c))
                    return true;
                PathCondition<C, S> p = PathCondition.newExpCondition(stclContext, c, link);
                return p.verify(stclContext, link);
            }
        }
    }
    return false;
}

From source file:com.bellman.bible.service.format.osistohtml.taghandler.TagHandlerHelper.java

/**
 * see if an attribute exists and has a value
 * //from   w w w  .j av a2 s  .c  o m
 * @param attributeName
 * @param attrs
 * @return
 */
public static boolean isAttr(String attributeName, Attributes attrs) {
    String attrValue = attrs.getValue(attributeName);
    return StringUtils.isNotEmpty(attrValue);
}