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.hp.application.automation.tools.model.AbstractSvRunModel.java

public String getServerName() {
    return (StringUtils.isNotBlank(serverName)) ? serverName : null;
}

From source file:com.btobits.automator.fix.ant.task.FixStartTask.java

@Override
protected void validate() throws Exception {
    Assert.assertTrue("Reference to FIX session is not specified", StringUtils.isNotBlank(refId));
}

From source file:io.github.jeddict.orm.generator.service.packageinfo.PackageInfoClassDefSnippet.java

public boolean isJaxbMetadataExist() {
    return StringUtils.isNotBlank(getNamespace());
}

From source file:com.sugaronrest.restapicalls.ModuleInfo.java

/**
 * Creates ModuleInfo object based or module type or SugarCRM module name.
 * /*from   ww  w  . j a v a 2s  .c om*/
 * @param type The Java Pojo module type (e.g Accounts.class).
 * @param moduleName The SugarCRM module name.
 * @return The created ModuleInfo object.
 * @throws Exception
 */
public static ModuleInfo create(Type type, String moduleName) throws Exception {
    ModuleInfo moduleInfo = null;
    if (type != null) {
        moduleInfo = readByType(type);
    }
    if ((moduleInfo == null) && StringUtils.isNotBlank(moduleName)) {
        moduleInfo = readByName(moduleName);
    }

    return moduleInfo;
}

From source file:de.unioninvestment.eai.portal.portlet.crud.ui.security.EncryptionFormatter.java

@Override
public String convertToPresentation(String value, Class<? extends String> targetType, Locale locale)
        throws com.vaadin.data.util.converter.Converter.ConversionException {

    if (StringUtils.isNotBlank(value)) {
        try {/*from   ww w .j ava  2  s.co  m*/
            return cryptor.decrypt(value);
        } catch (RuntimeException e) {
            throw new ConversionException("Cannot decrypt: " + e.getMessage());
        }
    } else {
        return null;
    }
}

From source file:io.sidecar.org.UserGroup.java

private UserGroup(UUID id, UUID appId, String name, Map<String, String> metadata, List<UserGroupMember> members,
        List<String> deviceIds) {
    checkNotNull(id, "UserGroup must have a non-null id");
    this.id = id;

    checkNotNull(appId, "UserGroup must have a non-null appId");
    this.appId = appId;

    checkArgument(StringUtils.isNotBlank(name) && name.length() <= 100,
            "UserGroup name must be non-blank and less than or equal to 100 characters in length.");
    this.name = name;

    this.metadata = (metadata == null) ? ImmutableMap.<String, String>of() : ImmutableMap.copyOf(metadata);
    this.members = (members == null) ? ImmutableList.<UserGroupMember>of() : ImmutableList.copyOf(members);
    this.deviceIds = (deviceIds == null) ? ImmutableList.<String>of() : ImmutableList.copyOf(deviceIds);
    checkAllDeviceIdsAreValid();//from w w w.  j a  va2s . c o m
}

From source file:com.rsmart.kuali.kfs.fp.businessobject.BatchDisbursementVoucherNonResidentAlienTax.java

/**
 * Takes a <code>String</code> and attempt to format as <code>Boolean</code> for setting the foreignSourceIncomeCode field
 * //from   w ww.  j a v  a  2 s .  c o  m
 * @param foreignSourceIncomeCode as string
 */
public void setForeignSourceIncomeCode(String foreignSourceIncomeCode) {
    if (StringUtils.isNotBlank(foreignSourceIncomeCode)) {
        Boolean foreignSourceIncome = (Boolean) (new BooleanFormatter())
                .convertFromPresentationFormat(foreignSourceIncomeCode);
        super.setForeignSourceIncomeCode(foreignSourceIncome);
    }
}

From source file:com.safetys.framework.jmesa.limit.LimitActionFactory.java

/**
 * @return The max rows based on what the user selected. A null returned implies the default
 *         must be used./*from www. j  a v  a  2 s .  co m*/
 */
public Integer getMaxRows() {
    String maxRows = LimitUtils.getValue(parameters.get(prefixId + Action.MAX_ROWS.toParam()));
    if (StringUtils.isNotBlank(maxRows)) {
        if (logger.isDebugEnabled()) {
            logger.debug("Max Rows:" + maxRows);
        }
        return Integer.parseInt(maxRows);
    }

    return null;
}

From source file:ar.com.zauber.garfio.modules.mantis.model.MantisTrackerSessionProvider.java

/**
 * Creates the MantisTrackerSessionProvider.
 *
 *//*from  ww  w . ja v  a 2 s.c  o  m*/
public MantisTrackerSessionProvider(final URI garfioURL, final String garfioPassword) {
    Validate.notNull(garfioURL);
    Validate.isTrue(StringUtils.isNotBlank(garfioPassword));

    this.garfioURL = garfioURL.toASCIIString();
    this.garfioPassword = garfioPassword;
}

From source file:com.ah.ui.actions.tools.ClientMgmtTestAction.java

@Override
public String execute() {

    try {//from  w ww. j  ava2 s . c  o m
        if ("test".equals(operation)) {
            jsonObject = new JSONObject();

            String customerId = LicenseOperationTool.getCustomerIdFromRemote(getDomain().getInstanceId());
            PairValue<Boolean, PairValue<String, String>> rtnvalue = CertificateGenSV
                    .troubleshooting(customerId, getDomain());
            String message = rtnvalue.getDesc().getValue();
            String warningMessage = rtnvalue.getDesc().getDesc();
            if (rtnvalue.getValue()) {
                jsonObject.put("succ", true);
                if (StringUtils.isBlank(message)) {
                    jsonObject.put("msg",
                            MgrUtil.getUserMessage("home.hmSettings.clientManagement.troubleshooting.success"));
                }
            } else {
                jsonObject.put("succ", false);
                if (Integer.parseInt(message) > 0) {
                    message = MgrUtil.getEnumString(CertificateGenSV.TROUBLESHOOTING_EXCEPTION + message);
                }
                jsonObject.put("msg", MgrUtil.getUserMessage(
                        "home.hmSettings.clientManagement.troubleshooting.failure.reason", message));
            }
            if (StringUtils.isNotBlank(warningMessage)) {
                jsonObject.put("warn", warningMessage);
            }
            return "json";
        }
    } catch (Exception e) {

    }
    return SUCCESS;
}