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

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

Introduction

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

Prototype

public static boolean isNotBlank(String str) 

Source Link

Document

Checks if a String is not empty (""), not null and not whitespace only.

Usage

From source file:com.zxy.commons.hystrix.HystrixAutoConfigureCondition.java

@Override
public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
    String enabled = context.getEnvironment().getProperty("hystrix.enabled");
    if (StringUtils.isNotBlank(enabled) && "false".equalsIgnoreCase(enabled)) {
        return false;
    }/*from w  w  w  .  j  av a 2s.  c  o  m*/
    try {
        // ?jar?, ?, ??
        context.getClassLoader().loadClass(Hystrix.class.getName());
        return true;
    } catch (Exception ex) {
        return false;
    }
}

From source file:io.renren.modules.sys.service.impl.SysLogServiceImpl.java

@Override
public PageUtils queryPage(Map<String, Object> params) {
    String key = (String) params.get("key");

    Page<SysLogEntity> page = this.selectPage(new Query<SysLogEntity>(params).getPage(),
            new EntityWrapper<SysLogEntity>().like(StringUtils.isNotBlank(key), "username", key));

    return new PageUtils(page);
}

From source file:com.bsb.intellij.plugins.xmlbeans.facet.ui.validation.ValidJvmMemoryParameterValidator.java

@Nullable
@Override/*ww w. j av  a  2  s  .c om*/
public String getErrorMessage(JTextField textField, JBLabel label) {
    String text = textField.getText();
    if (StringUtils.isNotBlank(text) && !ValidationUtils.isValidJvmMemoryParameter(text)) {
        return label.getText() + " should be a valid memory parameter (e.g. 256M)";
    }
    return null;
}

From source file:au.org.ala.delta.directives.PrintHeading.java

@Override
public void process(DeltaContext context, DirectiveArguments directiveArguments) throws Exception {
    String heading = context.getHeading(HeadingType.HEADING);
    au.org.ala.delta.translation.PrintFile printFile = context.getOutputFileSelector().getPrintFile();
    if (heading == null) {
        heading = "";
    }/*from  ww  w  . ja  va  2  s  .c o  m*/
    if (StringUtils.isNotBlank(heading)) {
        printFile.writeBlankLines(2, 0);
        printFile.outputLine(heading);
        printFile.writeBlankLines(2, 0);
    }
}

From source file:net.erdfelt.android.sdkfido.FetchTarget.java

public boolean hasSCM() {
    return StringUtils.isNotBlank(this.branchname);
}

From source file:com.ssic.education.handle.dao.ProLicenseDao.java

public List<ProLicense> findById(String id, Integer cerSource) {
    ProLicenseExample example = new ProLicenseExample();
    ProLicenseExample.Criteria criteria = example.createCriteria();
    if (StringUtils.isNotBlank(id)) {
        criteria.andRelationIdEqualTo(id);
    }/*from  ww w  .  java  2 s  .  co  m*/
    if (null != cerSource) {
        criteria.andCerSourceEqualTo(cerSource.shortValue());
    }
    criteria.andStatEqualTo(DataStatus.ENABLED);
    List<ProLicense> proLicenses = mapper.selectByExample(example);
    return proLicenses;
}

From source file:com.prowidesoftware.swift.model.field.SwiftParseUtils.java

/**
 * Split components of a line, with an optional starting string and a component separator.
 * Adjacent separators are treated as one separator.
 * This method does not validate the starting string presence, it just strips it if present.
 * this methods uses {@link StringUtils#splitByWholeSeparator(String, String)}
 *
 * @param line the string to parse/*w  w  w.  ja va  2s.  c  om*/
 * @param starting an optional starting string
 * @param separator the components separator
 * @return a list of String with the found components or an empty list if none is found
 */
public static List<String> splitComponents(final String line, final String starting, final String separator) {
    final ArrayList<String> result = new ArrayList<String>();

    if (StringUtils.isNotBlank(line)) {
        String lineNoPrefix = removePrefix(line, starting);

        if (StringUtils.isNotBlank(separator)) {
            final String[] tokens = StringUtils.splitByWholeSeparator(lineNoPrefix, separator);
            //add not empty tokens to result
            for (int i = 0; i < tokens.length; i++) {
                if (StringUtils.isNotBlank(tokens[i])) {
                    result.add(tokens[i]);
                }
            }
        } else {
            result.add(lineNoPrefix);
        }
    }
    return result;
}

From source file:de.hybris.platform.b2b.punchout.services.CXMLBuilderTest.java

@Test
public void shouldCreateValidRootElemet() {
    final CXML root = builder.create();
    assertTrue(StringUtils.isNotBlank(root.getPayloadID()));
    assertTrue(StringUtils.isNotBlank(root.getTimestamp()));
}

From source file:ips1ap101.web.commons.assistants.ext.AsistentePaginaActualizacionRastroFuncionX.java

/**
 * campoFuncion1Boton2.onClick//from   w w  w.  j  av  a  2  s . com
 */
@Override
public String getScriptCampoIdFuncion1Boton2() {
    String script = null;
    RowKey rowKey = bean.getGestor().getCurrentRowKey();
    if (bean.getRastroFuncionDataProvider().isRowAvailable(rowKey)) {
        String pagina = bean.getRastroFuncionDataProvider().getPaginaFuncion(rowKey);
        String urx = BaseBundle.getPage(pagina);
        if (StringUtils.isNotBlank(urx)) {
            Long funcion = bean.getRastroFuncionDataProvider().getIdFuncion(rowKey);
            Long recurso = bean.getRastroFuncionDataProvider().getRecursoValor(rowKey);
            ListaParametros rpl = new ListaParametros();
            rpl.addParametro(CPP.ID_FUNCION_REFERENCIA, funcion);
            if (recurso != null) {
                rpl.addParametro(CPP.ID_RECURSO, recurso);
            }
            script = JSF.getOpenWindowJavaScript(urx, rpl.toString());
        } else {
            script = getScriptCampoRecursoValor1Boton2();
        }
    }
    return script != null ? script : super.getScriptCampoIdFuncion1Boton2();
}

From source file:ips1ap101.web.commons.assistants.ext.AsistentePaginaActualizacionRastroInformeX.java

/**
 * campoFuncion1Boton2.onClick/*from   www  .ja  va 2 s  . co m*/
 */
@Override
public String getScriptCampoIdFuncion1Boton2() {
    String script = null;
    RowKey rowKey = bean.getGestor().getCurrentRowKey();
    if (bean.getRastroInformeDataProvider().isRowAvailable(rowKey)) {
        String pagina = bean.getRastroInformeDataProvider().getPaginaFuncion(rowKey);
        String urx = BaseBundle.getPage(pagina);
        if (StringUtils.isNotBlank(urx)) {
            Long funcion = bean.getRastroInformeDataProvider().getIdFuncion(rowKey);
            Long recurso = bean.getRastroInformeDataProvider().getRecursoValor(rowKey);
            ListaParametros rpl = new ListaParametros();
            rpl.addParametro(CPP.ID_FUNCION_REFERENCIA, funcion);
            if (recurso != null) {
                rpl.addParametro(CPP.ID_RECURSO, recurso);
            }
            script = JSF.getOpenWindowJavaScript(urx, rpl.toString());
        } else {
            script = getScriptCampoRecursoValor1Boton2();
        }
    }
    return script != null ? script : super.getScriptCampoIdFuncion1Boton2();
}