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

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

Introduction

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

Prototype

public static boolean isNotEmpty(String str) 

Source Link

Document

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

Usage

From source file:com.cloudera.nav.sdk.client.writer.registry.MClassRegistry.java

public MClassRegistry(String namespace) {
    Preconditions.checkArgument(StringUtils.isNotEmpty(namespace),
            "Must supply non-empty namespace identifying client application");
    propertyRegistry = (new MPropertyEntryFactory()).newRegistry();
    relationRegistry = (new MRelationEntryFactory()).newRegistry();
    this.namespace = namespace;
}

From source file:com.enonic.cms.business.localization.LocalizationServiceImpl.java

public String getLocalizedPhrase(SiteEntity site, String phrase, Object[] arguments, Locale locale) {
    if (noLocalizationResourceDefinedForSite(site)) {
        return createNotTranslated(phrase);
    }//w w w.j a  v  a 2  s  .c o m

    if (locale == null) {
        return createNotTranslated(phrase);
    }

    LocalizationResourceBundle localizationResourceBundle = getResourceBundleForLocale(site, locale);

    if (localizationResourceBundle == null) {
        return createNotTranslated(phrase);
    }

    String localizedPhrase = getLocalizedPhrase(phrase, arguments, localizationResourceBundle);

    return StringUtils.isNotEmpty(localizedPhrase) ? localizedPhrase : createNotTranslated(phrase);
}

From source file:cn.cuizuoli.appranking.typehandler.CountryTypeHandler.java

@Override
public Country getNullableResult(ResultSet rs, String columnName) throws SQLException {
    Country country = null;//from  ww  w.  j  a  v  a  2 s.  c o  m
    String s = rs.getString(columnName);
    if (StringUtils.isNotEmpty(s)) {
        country = Country.getObject(s);
    }
    return country;
}

From source file:com.haulmont.cuba.core.jmx.ViewRepositoryInfo.java

protected void dump(ViewProperty viewProperty, StringBuilder content, String indent) {
    content.append("\n");
    content.append(indent);/*w w  w.  j a va2 s .com*/
    content.append("- ").append(viewProperty.getName());
    View innerView = viewProperty.getView();
    if (innerView != null) {
        if (StringUtils.isNotEmpty(innerView.getName())) {
            content.append(" -> ").append(metadata.getSession().getClass(innerView.getEntityClass()).getName())
                    .append("/").append(innerView.getName());
        } else {
            for (ViewProperty innerProperty : innerView.getProperties()) {
                dump(innerProperty, content, "  " + indent);
            }
        }
    }
}

From source file:com.bstek.dorado.web.servlet.ServletContextResourceLoader.java

public ServletContextResourceLoader(ServletContext servletContext) {
    this.servletContext = servletContext;
    String resourceLoaderClass = servletContext.getInitParameter("resourceLoaderClass");
    if (StringUtils.isNotEmpty(StringUtils.trim(resourceLoaderClass))) {
        ConsoleUtils.outputLoadingInfo("[resourceLoaderClass=" + resourceLoaderClass + "]");

        try {//w  w  w .j  a v a2s  . co  m
            @SuppressWarnings("unchecked")
            Class<ResourceLoader> type = ClassUtils.forName(resourceLoaderClass);
            Constructor<ResourceLoader> constr = type.getConstructor(new Class[] { ClassLoader.class });
            resourceLoader = constr.newInstance(new Object[] { getClass().getClassLoader() });
        } catch (Exception e) {
            logger.error(e, e);
        }
    }
}

From source file:cn.cuizuoli.appranking.typehandler.FeedTypeTypeHandler.java

@Override
public FeedType getNullableResult(ResultSet rs, String columnName) throws SQLException {
    FeedType feedType = null;//from w  w  w. j av  a2  s  .c om
    String s = rs.getString(columnName);
    if (StringUtils.isNotEmpty(s)) {
        feedType = FeedType.getObject(s);
    }
    return feedType;
}

From source file:com.wso2telco.model.backchannel.BackChannelTokenResponse.java

public BackChannelTokenResponse(String status, BackChannelTokenResponse backChannelTokenResponse) {

    if (StringUtils.isNotEmpty(status) && status.equalsIgnoreCase("APPROVED")) {
        this.auth_req_id = backChannelTokenResponse.getAuthReqId();
        this.access_token = backChannelTokenResponse.getAccessToken();
        this.token_type = backChannelTokenResponse.getTokenType();
        this.id_token = backChannelTokenResponse.getIdToken();
        this.expires_in = backChannelTokenResponse.getExpiresIn();
        this.refresh_token = backChannelTokenResponse.getRefreshToken();
        this.correlation_id = backChannelTokenResponse.getCorrelationId();
    } else {/*from  w w  w.  ja  va  2 s.  c o  m*/
        this.auth_req_id = backChannelTokenResponse.getAuthReqId();
        this.correlation_id = backChannelTokenResponse.getCorrelationId();
        this.error = backChannelTokenResponse.getError();
        this.error_description = backChannelTokenResponse.getErrorDescription();
    }
}

From source file:de.hybris.platform.acceleratorservices.payment.cybersource.converters.populators.request.AbstractRequestPopulator.java

/**
 * Common method to add a query parameter to the target {@link Map}<{@link String}, {@link String}>.
 * //from ww  w .j a va 2s  . co  m
 * @param target
 *           - the Map<String, String>.
 * @param name
 *           - the query parameter name.
 * @param value
 *           - the query parameter value.
 */
protected void addRequestQueryParam(final PaymentData target, final String name, final String value) {
    validateParameterNotNull(target, "Parameter target (PaymentData) cannot be null");

    final Map<String, String> parameterMap = (target.getParameters() != null ? target.getParameters()
            : new HashMap<String, String>());

    if (StringUtils.isNotEmpty(name) && StringUtils.isNotEmpty(value)) {
        parameterMap.put(name, value);
    }

    target.setParameters(parameterMap);
}

From source file:gov.nih.nci.cabig.caaers.domain.dto.AdverseEventDTO.java

public boolean isSame(AdverseEventDTO other) {
    if (StringUtils.isNotEmpty(externalID)) {
        if (StringUtils.equals(externalID, other.externalID))
            return true;
    }/*from ww  w .  j a v a  2  s  .c o m*/
    return term.isSame(other.term) && StringUtils.equals(grade, other.grade)
            && StringUtils.equals(startDate, other.startDate) && StringUtils.equals(endDate, other.endDate)
            && StringUtils.equals(verbatim, other.verbatim) && StringUtils.equals(whySerious, other.whySerious)
            && StringUtils.equals(attribution, other.attribution);
}

From source file:cn.cuizuoli.appranking.typehandler.MediaTypeTypeHandler.java

@Override
public MediaType getNullableResult(ResultSet rs, String columnName) throws SQLException {
    MediaType mediaType = null;/*from   www .j a  v  a2s. c  o m*/
    String s = rs.getString(columnName);
    if (StringUtils.isNotEmpty(s)) {
        mediaType = MediaType.getObject(s);
    }
    return mediaType;
}