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:bigbluej.JoinCommand.java

public JoinCommand(String fullName, String meetingID, String password, Long createTime, String userId,
        String webConfigConf, String configToken, String avatarURL, boolean redirectClient, String clientURL) {
    Validate.notEmpty(fullName, "fullName");
    Validate.notEmpty(meetingID, "meetingID");
    Validate.notEmpty(password, "password");
    this.fullName = fullName;
    this.meetingID = meetingID;
    this.password = password;
    this.createTime = createTime;
    this.userId = userId;
    this.webConfigConf = webConfigConf;
    this.configToken = configToken;
    this.avatarURL = avatarURL;
    this.redirectClient = redirectClient;
    this.clientURL = clientURL;
}

From source file:io.cloudslang.engine.partitions.services.PartitionServiceImpl.java

@Override
@Transactional/*  www  .j a  v  a  2  s  . c o  m*/
public void createPartitionGroup(String groupName, int groupSize, long timeThreshold, long sizeThreshold) {
    Validate.notEmpty(groupName, "Group name is empty or null");
    Validate.isTrue(groupSize >= MIN_GROUP_SIZE, formatMessage2Small("Group size", groupSize, MIN_GROUP_SIZE));
    //      Validate.isTrue(timeThreshold==-1 || timeThreshold >= MIN_TIME_THRESHOLD, formatMessage2Small("Time threshold", timeThreshold, MIN_TIME_THRESHOLD));
    //      Validate.isTrue(sizeThreshold==-1 || sizeThreshold >= MIN_SIZE_THRESHOLD, formatMessage2Small("Size threshold", sizeThreshold, MIN_SIZE_THRESHOLD));

    repository.save(new PartitionGroup(groupName, groupSize, timeThreshold, sizeThreshold));
    if (logger.isInfoEnabled())
        logger.info("Partition group [" + groupName + "] was created, with group size " + groupSize
                + ", and timeThreshold " + timeThreshold + ", and sizeThreshold " + sizeThreshold);
}

From source file:com.fusesource.examples.horo.web.HoroscopeService.java

@GET
@Path("/signs/{starSign}")
public HoroscopesResponseVO getHoroscopes(@PathParam("starSign") String requestedSign) {
    LOG.info("getHoroscopes({})", requestedSign);
    Validate.notEmpty(requestedSign, "requestedSign is empty");
    StarSign starSign = StarSign.getInstance(requestedSign);
    Validate.notNull(starSign, "could not resolve " + requestedSign + " to a valid sign");

    List<Horoscope> horoscopes = getHoroscopes(starSign);
    return new HoroscopeTranslator().toHoroscopesResponseVO(horoscopes);
}

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

@Override
public List<Component> findSubscribedByStrategyInclSecurity(String strategyName) {

    Validate.notEmpty(strategyName, "Strategy name is empty");

    return findCaching("Component.findSubscribedByStrategyInclSecurity", QueryType.BY_NAME,
            new NamedParam("strategyName", strategyName));
}

From source file:ar.com.zauber.commons.spring.beans.factory.impl.HostnameCaseBlock.java

/** constructor */
public HostnameCaseBlock(final String[] expectedHostnames, final HostnameProvider hostnameProvider,
        final Object object) {
    Validate.notEmpty(expectedHostnames, "expectedHostnames");
    Validate.notNull(hostnameProvider, "hostnameProvider");
    Validate.notNull(object, "factoryBean");

    this.expectedHostNames = expectedHostnames;
    this.hostnameProvider = hostnameProvider;
    this.object = object;
}

From source file:com.stealthyone.mcb.stbukkitlib.utils.StringUtils.java

/**
 * Checks if the input string contains any of the values, case sensitive.
 *
 * @param input Input string.//from   w  ww .ja v a  2  s.  c o m
 * @param values List of values to check.
 * @return True if any of the values exist in the input string.<br />
 *         False if none of the values exist in the input string.
 */
public static boolean containsMultiple(String input, String... values) {
    Validate.notNull(input, "Input cannot be null.");
    Validate.notNull(values, "Values cannot be null.");
    Validate.notEmpty(values, "Values cannot be empty.");

    for (String str : values) {
        if (input.contains(str)) {
            return true;
        }
    }
    return false;
}

From source file:ch.algotrader.dao.TransactionDaoImpl.java

@Override
public List<Transaction> findByStrategy(String strategyName) {

    Validate.notEmpty(strategyName, "Strategy name is empty");

    return findCaching("Transaction.findByStrategy", QueryType.BY_NAME,
            new NamedParam("strategyName", strategyName));
}

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

@Override
public List<Combination> findSubscribedByStrategy(String strategyName) {

    Validate.notEmpty(strategyName, "Strategy name is empty");

    return findCaching("Combination.findSubscribedByStrategy", QueryType.BY_NAME,
            new NamedParam("strategyName", strategyName));
}

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

@Override
public BigDecimal findLastIntOrderIdBySessionQualifier(String sessionQualifier) {

    Validate.notEmpty(sessionQualifier, "Session qualifier is empty");

    return (BigDecimal) findUniqueObject(null, "Order.findLastIntOrderIdBySessionQualifier", QueryType.BY_NAME,
            new NamedParam("sessionQualifier", sessionQualifier));
}

From source file:ch.algotrader.adapter.bb.BBSessionStateHolder.java

public BBSessionStateHolder(final String name, final EventDispatcher eventDispatcher) {
    Validate.notEmpty(name, "Session name is null");
    Validate.notNull(eventDispatcher, "PlatformEventDispatcher is null");

    this.name = name;
    this.eventDispatcher = eventDispatcher;
    this.connState = new AtomicReference<>(ConnectionState.DISCONNECTED);
}