Example usage for org.apache.commons.lang Validate notEmpty

List of usage examples for org.apache.commons.lang Validate notEmpty

Introduction

In this page you can find the example usage for org.apache.commons.lang Validate notEmpty.

Prototype

public static void notEmpty(String string) 

Source Link

Document

Validate an argument, throwing IllegalArgumentException if the argument String is empty (null or zero length).

 Validate.notEmpty(myString); 

The message in the exception is 'The validated string is empty'.

Usage

From source file:com.tripod.api.query.Query.java

public Query(final String query, final Integer offset, final Integer rows) {
    this.query = query;
    this.offset = offset;
    this.rows = rows;

    Validate.notEmpty(query);
    Validate.notNull(offset);/*  ww  w . j av  a  2 s  . co  m*/
    Validate.isTrue(offset >= 0);
    Validate.notNull(rows);
    Validate.isTrue(rows > 0);
}

From source file:com.fusesource.examples.horo.rssReader.RssConsumerRouteBuilder.java

@PostConstruct
public void checkMandatoryProperties() {
    Validate.notEmpty(sourceName);
    Validate.notEmpty(sourceUri);
    Validate.notEmpty(targetUri);
    Validate.notNull(repositoryBuilder);
}

From source file:ar.com.zauber.commons.spring.mail.JdbcMailSender.java

/**
 * Creates the JdbcSwingMailSender./*from w  w  w .  j a  v a 2 s.  com*/
 *
 * @param jdbcTemplate jdbc template
 * @param tablename the name of the table
 */
public JdbcMailSender(final JdbcTemplate jdbcTemplate, final String tablename) {
    Validate.notNull(jdbcTemplate);
    Validate.notEmpty(tablename);

    this.jdbcTemplate = jdbcTemplate;
    this.tablename = tablename;
}

From source file:com.vmware.identity.saml.config.impl.ConfigExtractorImpl.java

public ConfigExtractorImpl(String tenantName, CasIdmClient client)
        throws NoSuchIdPException, SystemConfigurationException {
    Validate.notEmpty(tenantName);
    Validate.notNull(client);/*  ww w  .j a v  a 2 s. c  om*/

    this.tenantName = tenantName;
    this.client = client;

    Tenant tenant = getTenant();
    assert tenant != null;
}

From source file:com.googlecode.t7mp.configuration.LocalMavenRepositoryArtifactResolver.java

@Override
public File resolveArtifact(String coordinates) throws ResolutionException {
    Validate.notEmpty(coordinates);
    AbstractArtifact artifact;/*w ww.  j  a  v  a 2  s  .c  o m*/
    try {
        artifact = Artifacts.fromCoordinates(coordinates);
    } catch (InvalidCoordinatesException e) {
        throw new ResolutionException("Invalid MavenCoordinates " + coordinates);
    }
    String relativePath;
    relativePath = createRelativeArtifactPath(artifact);
    File result = new File(this.localMavenRepository, relativePath);
    if (!result.isFile()) {
        throw new ResolutionException("Resolved file is a directory.");
    } else if (!result.exists()) {
        throw new ResolutionException("File " + result.getAbsolutePath() + " does not exist.");
    }
    return result;
}

From source file:ar.com.zauber.commons.spring.test.impl.TamperdataHttpServletRequestFactory.java

/** constructor */
public TamperdataHttpServletRequestFactory(final String encoding) {
    Validate.notEmpty(encoding);
    this.encoding = encoding;
}

From source file:cn.vko.cache.dao.rw.DefaultDataSourceService.java

@Override
public void afterPropertiesSet() throws Exception {
    if (haDataSourceCreator == null) {
        setHaDataSourceCreator(new NonHADataSourceCreator());
    }/* www .j a  v  a 2  s.  c  o m*/
    for (DataSourceDescriptor descriptor : dataSourceDescriptors) {
        Validate.notEmpty(descriptor.getIdentity());
        Validate.notNull(descriptor.getTarget());
        DataSource dataSourceToUse = descriptor.getTarget();
        if (descriptor.getStandby() != null) {
            dataSourceToUse = haDataSourceCreator.createHADataSource(descriptor);
        }
        dataSourceToUse = new LazyConnectionDataSourceProxy(dataSourceToUse);
        dataSources.put(descriptor.getIdentity(), dataSourceToUse);
        //
        if ("read".equalsIgnoreCase(descriptor.getType())) {
            readDataSources.add(dataSourceToUse);
        } else if ("write".equalsIgnoreCase(descriptor.getType())) {
            writeDataSources.add(dataSourceToUse);
        }
    }
}

From source file:com.vmware.identity.idm.IDPConfig.java

/**
 *
 * @param aEntityId
 *            Cannot be null or empty
 */
public IDPConfig(String aEntityId) {
    Validate.notEmpty(aEntityId);
    entityID = aEntityId;
}

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

/**
 * //from ww  w. j a v  a  2 s . co m
 * Creates the UpdateCustomFieldAction.
 *
 * @param issue issue to modify
 * @param session tracker session
 * @param field to change
 * @param value to set
 */
public UpdateCustomFieldAction(final MantisIssue issue, final MantisTrackerSession session, final String field,
        final String value) {
    super(issue, session);
    Validate.notEmpty(field);
    Validate.notEmpty(value);
    this.field = field;
    this.value = value;

    trackerCustomFieldList = mantisIssue.getIssueData().getCustom_fields();

    if (trackerCustomFieldList != null) {
        for (final CustomFieldValueForIssueData customField : trackerCustomFieldList) {
            if (customField.getField().getName().equals(this.field)) {
                this.trackerCustomField = customField;
                break;
            }
        }
    }
}

From source file:ar.com.zauber.garfio.modules.jira.model.actions.ResolveIssueAction.java

/** constructor */
public ResolveIssueAction(final JiraIssue issue, final JiraTrackerSession session, final String uid) {

    Validate.notNull(issue);/* www  . j a v a2  s .c  o m*/
    Validate.notNull(session);
    Validate.notEmpty(uid);

    this.issue = issue;
    this.session = session;
    this.uid = uid;
}