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.hiperium.web.socket.common.DeviceSocketDecoder.java

/**
 * {@inheritDoc}
 */
@Override
public boolean willDecode(String json) {
    return (StringUtils.isNotBlank(json));
}

From source file:com.baidu.rigel.biplatform.ac.util.ResponseResultUtils.java

/**
 * /*from   w  ww  .ja v a 2s. c  o m*/
 * 
 * @param successMessage
 * @param data
 * @return
 */
public static ResponseResult getCorrectResult(String successMessage, Object data) {
    ResponseResult rs = new ResponseResult();
    rs.setStatus(ResponseResult.SUCCESS);
    //        rs.setStatusInfo(successMessage);
    rs.setData(data);
    try {
        String errorMessage = (String) ThreadLocalPlaceholder.getProperty(ThreadLocalPlaceholder.ERROR_MSG_KEY);
        if (StringUtils.isNotBlank(errorMessage)) {
            rs.setStatusInfo(errorMessage);
        }
    } catch (Exception e) {
    } finally {
        ThreadLocalPlaceholder.unbindProperty(ThreadLocalPlaceholder.ERROR_MSG_KEY);
    }
    return rs;
}

From source file:com.haulmont.ext.core.app.CallGeneratorNumberServiceBean.java

@Override
public String getNextNumber(Call call) {
    Transaction tx = persistence.createTransaction();
    try {/*from   w ww  .  j a va  2  s  .  c om*/
        //DeptConfig config = ConfigProvider.getConfig(DeptConfig.class);
        String numeratorName = "";
        String num = null;
        if (StringUtils.isNotBlank(numeratorName)) {
            EntityManager em = persistence.getEntityManager();
            Query q = em.createQuery("select n from df$Numerator n where n.name = ?1");
            q.setParameter(1, numeratorName);
            List<Numerator> list = q.getResultList();
            if (!list.isEmpty()) {
                Map<String, Object> map = new HashMap<String, Object>();
                map.put("entity", call);
                num = numerationWorker.getNextNumber(list.get(0), map);
            }
        }
        tx.commit();
        return num;
    } finally {
        tx.end();
    }
}

From source file:com.billing.ng.crypto.profile.hash.BCryptProfile.java

private Integer getWorkFactor() {
    if (workFactor == null) {
        String prop = System.getProperty("crypto.hash.work_factor", "12");
        workFactor = StringUtils.isNotBlank(prop) ? Integer.valueOf(prop) : 12;
    }/*from   w  ww .j  a va2  s. co m*/
    return workFactor;
}

From source file:com.ultrapower.eoms.common.plugin.ecside.table.tool.ExtendTool.java

 @Override
public void buildTool() {

   String extend = (String) getTableModel().getTable()
         .getAttribute("ExtendTool");
   getHtmlBuilder().td(1).styleClass("extendTool").close();
   if (StringUtils.isNotBlank(extend)) {
      getHtmlBuilder().append(extend);//from  w ww  . j a v  a  2  s  .  c  om
   }
   getHtmlBuilder().tdEnd();

}

From source file:net.shopxx.service.impl.SensitivityServiceImpl.java

@SuppressWarnings("static-access")
@Override//from   w  w  w .  j  av a 2  s  .c  om
public String replaceSensitivity(String source, String to) {
    if (StringUtils.isNotBlank(source)) {
        List<Sensitivity> list = sensitivityDao.findList(null, null, null, null);
        List<String> strList = new ArrayList<String>();
        if (list != null && list.size() > 0) {
            for (Sensitivity si : list) {
                strList.add(si.getSearch());
            }
            KeywordFilter filter = new KeywordFilter();
            filter.addKeywords(strList);
            List<String> set = filter.getTxtKeyWords(source);
            if (set.size() > 0) {
                source = filter.str_replace1(set.toString(), to, source);
            }
        }
    }
    return source;
}

From source file:com.nagarro.core.validator.PaymentDetailsDTOValidator.java

@Override
public void validate(final Object target, final Errors errors) {
    final PaymentDetailsWsDTO paymentDetails = (PaymentDetailsWsDTO) target;

    if (StringUtils.isNotBlank(paymentDetails.getStartMonth())
            && StringUtils.isNotBlank(paymentDetails.getStartYear())
            && StringUtils.isNotBlank(paymentDetails.getExpiryMonth())
            && StringUtils.isNotBlank(paymentDetails.getExpiryYear())) {
        final Calendar start = Calendar.getInstance();
        start.set(Calendar.DAY_OF_MONTH, 0);
        start.set(Calendar.MONTH, Integer.parseInt(paymentDetails.getStartMonth()) - 1);
        start.set(Calendar.YEAR, Integer.parseInt(paymentDetails.getStartYear()) - 1);

        final Calendar expiration = Calendar.getInstance();
        expiration.set(Calendar.DAY_OF_MONTH, 0);
        expiration.set(Calendar.MONTH, Integer.parseInt(paymentDetails.getExpiryMonth()) - 1);
        expiration.set(Calendar.YEAR, Integer.parseInt(paymentDetails.getExpiryYear()) - 1);

        if (start.after(expiration)) {
            errors.rejectValue("startMonth", "payment.startDate.invalid");
        }// w  ww  . ja  va2s .com
    }

    ValidationUtils.rejectIfEmptyOrWhitespace(errors, "accountHolderName", "field.required");
    ValidationUtils.rejectIfEmptyOrWhitespace(errors, "cardType.code", "field.required");
    ValidationUtils.rejectIfEmptyOrWhitespace(errors, "cardNumber", "field.required");
    ValidationUtils.rejectIfEmptyOrWhitespace(errors, "expiryMonth", "field.required");
    ValidationUtils.rejectIfEmptyOrWhitespace(errors, "expiryYear", "field.required");

    paymentAddressValidator.validate(paymentDetails, errors);
}

From source file:com.daimler.spm.b2bacceleratoraddon.forms.AdvancedSearchForm.java

public List<String> getProductIdsList() {
    if (StringUtils.isNotBlank(getKeywords())) {
        if (CollectionUtils.isEmpty(productIdsList)) {
            this.productIdsList = new ArrayList<>();
        }// ww w.j  av a 2 s  . c  o m
        this.productIdsList.addAll(Arrays.asList(StringUtils.split(getKeywords(), ",; ")));
    }
    return productIdsList;
}

From source file:net.sourceforge.fenixedu.domain.accessControl.academicAdministration.EnumArray.java

public EnumArray(String serialized) {
    elements = new HashSet<T>();
    if (StringUtils.isNotBlank(serialized)) {
        for (String part : serialized.split(SEPARATOR)) {
            elements.add(resolve(part));
        }/*  w ww .  jav  a2  s.co m*/
    }
}

From source file:com.github.born2snipe.maven.log.AddTimestampFilter.java

private boolean isPatternProvided(Context context) {
    return StringUtils.isNotBlank(context.config.getTimestampPattern());
}