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, String message) 

Source Link

Document

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

 Validate.notEmpty(myString, "The string must not be empty"); 

Usage

From source file:ch.algotrader.dao.security.SecurityReferenceDaoImpl.java

@Override
public SecurityReference findByOwnerAndName(long ownerSecurityId, String name) {

    Validate.notEmpty(name, "Name is empty");

    return findUnique("SecurityReference.findByOwnerAndName", QueryType.BY_NAME,
            new NamedParam("ownerSecurityId", ownerSecurityId), new NamedParam("name", name));
}

From source file:com.evolveum.midpoint.common.filter.FilterManagerImpl.java

@Override
public Filter getFilterInstance(String uri, List<Object> parameters) {
    Validate.notEmpty(uri, "Filter uri must not be null or empty.");
    Class<T> clazz = filterMap.get(uri);
    if (clazz == null) {
        return null;
    }//  www  .jav  a  2 s .  c om

    Filter filter = null;
    try {
        filter = clazz.newInstance();
        filter.setParameters(parameters);
    } catch (Exception ex) {
        LoggingUtils.logException(LOGGER, "Couln't create filter instance", ex);
    }

    return filter;
}

From source file:ch.algotrader.dao.exchange.ExchangeDaoImpl.java

@Override
public Exchange findByName(String name) {

    Validate.notEmpty(name, "Exchange name is empty");

    return findUniqueCaching("Exchange.findByName", QueryType.BY_NAME, new NamedParam("name", name));
}

From source file:ch.algotrader.service.LazyLoaderServiceImpl.java

/**
 * {@inheritDoc}// www  .java2 s .c  om
 */
@Override
public <T extends BaseEntityI> T lazyLoadProxy(BaseEntityI entity, String context, T proxy) {

    Validate.notNull(entity, "Entity is null");
    Validate.notEmpty(context, "Context is empty");
    Validate.notNull(proxy, "Proxy is null");

    return HibernateInitializer.INSTANCE.initializeProxy(entity, context, proxy);

}

From source file:com.edmunds.etm.system.api.ControllerInstance.java

public ControllerInstance(UUID id, String ipAddress, String version, FailoverState failoverState) {
    Validate.notNull(id, "Unique ID is null");
    Validate.notEmpty(ipAddress, "IP address is empty");
    Validate.notEmpty(version, "Version is empty");
    Validate.notNull(failoverState, "Failover state is null");
    this.id = id;
    this.ipAddress = ipAddress;
    this.version = version;
    this.failoverState = failoverState;
}

From source file:jenkins.plugins.coverity.CoverityTool.CoverityCommand.java

public CoverityCommand(@Nonnull String command, AbstractBuild<?, ?> build, Launcher launcher,
        TaskListener listener, CoverityPublisher publisher, String home, EnvVars envVars) {
    super(build, launcher, listener, publisher, envVars);

    Validate.notEmpty(command, "Command cannot be null empty or null");

    addCommand(command, home);/*  w ww  .j  av  a  2s.com*/
    addIntermediateDir();
}

From source file:eu.codesketch.adam.docker.model.event.Event.java

public Event(Long timestamp, String source, Action action) {
    notNull(timestamp, "event timestamp must be provided");
    Validate.notEmpty(source, "event source cannot be null");
    Validate.notNull(action, "event action must be provided");

    this.timestamp = timestamp;
    this.source = source;
    this.action = action;
}

From source file:ch.algotrader.dao.security.StockDaoImpl.java

@Override
public List<Stock> findBySectory(String code) {

    Validate.notEmpty(code, "Code is empty");

    return findCaching("Stock.findBySectory", QueryType.BY_NAME, new NamedParam("code", code));
}

From source file:ch.algotrader.dao.trade.OrderPreferenceDaoImpl.java

@Override
public OrderPreference findByName(String name) {

    Validate.notEmpty(name, "Name is empty");

    return findUniqueCaching("OrderPreference.findByName", QueryType.BY_NAME, new NamedParam("name", name));
}

From source file:ch.algotrader.dao.security.SecurityFamilyDaoImpl.java

@Override
public SecurityFamily findByName(String name) {

    Validate.notEmpty(name, "Name is empty");

    return findUnique("SecurityFamily.findByName", QueryType.BY_NAME, new NamedParam("name", name));
}