Example usage for org.springframework.util Assert notNull

List of usage examples for org.springframework.util Assert notNull

Introduction

In this page you can find the example usage for org.springframework.util Assert notNull.

Prototype

public static void notNull(@Nullable Object object, Supplier<String> messageSupplier) 

Source Link

Document

Assert that an object is not null .

Usage

From source file:fr.mby.portal.coreimpl.message.BasicEventMessage.java

/**
 * @param userAction/*from www.  j  a v a 2 s.co m*/
 * @param event
 */
protected BasicEventMessage(final IUserAction userAction, final IEvent event) {
    super(userAction);

    Assert.notNull(event, "No IEvent provided !");

    this.event = event;
}

From source file:demo.EmbeddedRedisServerBean.java

public EmbeddedRedisServerBean(RedisServer redisServer) {
    Assert.notNull(redisServer, "RedisServer may not be null");
    this.redisServer = redisServer;
}

From source file:org.juiser.spring.security.core.ForwardedUserAuthentication.java

public ForwardedUserAuthentication(UserDetails details) {
    Assert.notNull(details, "details argument cannot be null.");
    this.details = details;
}

From source file:org.springmodules.validation.util.condition.NonNullAcceptingCondition.java

/**
 * Checks whether the checked object is <code>null</code>.
 *
 * @param object The checked object./*from   ww  w .j  a  va2  s . co m*/
 * @throws IllegalArgumentException when the checked object is <code>null</code>.
 */
protected void beforeObjectChecked(Object object) {
    Assert.notNull(object, getClass().getName() + " cannot check 'null' values");
}

From source file:io.pivotal.spring.xd.jdbcgpfdist.support.DefaultLoadService.java

public DefaultLoadService(JdbcTemplate jdbcTemplate) {
    this.jdbcTemplate = jdbcTemplate;
    Assert.notNull(jdbcTemplate, "JdbcTemplate must be set");
}

From source file:org.jdbcluster.metapersistence.cluster.ClusterBase.java

public void setDao(Object dao) {

    Assert.notNull(dao, "dao may not be null");

    /*/*from ww w . ja  v  a  2 s . c om*/
     * @TODO
     * This was a try to implement a assignment check. Stay tuned ;-)
     */
    //      if (false) {
    //         if (daoClass != null) {
    //            if (!daoClass.equals(dao.getClass()) && !daoClass.isAssignableFrom(dao.getClass())) {
    //               throw new DaoException("Assigning wrong Dao type in ClusterType [" + ((clusterType != null) ? clusterType.getClusterClassName() : "unknown") + "]. Dao class is [" + dao.getClass().getName()
    //                     + "] and should be [" + daoClass.getName() + "]");
    //            }
    //         } else
    //            throw new DaoException("No Dao class set for ClusterType [" + ((clusterType != null) ? clusterType.getClusterClassName() : "unknown") + "]");
    //
    //      }

    this.dao = dao;
    this.daoClass = dao.getClass();
}

From source file:fr.mby.portal.coreimpl.message.BasicReplyFactory.java

@Override
public IReply build(final HttpServletResponse response, final MessageType messageType) {
    Assert.notNull(response, "No HttpServletResponse provided !");
    Assert.notNull(messageType, "No MessageType provided !");

    final IReply reply;

    switch (messageType) {
    case ACTION://w w w.j a v  a 2s . c o m
        reply = new BasicActionReply();
        break;
    case RENDER:
        reply = new BasicRenderReply(response);
        break;
    case EVENT:
        reply = new BasicEventReply();
        break;
    default:
        throw new IllegalArgumentException("Unknown message type !");
    }

    return reply;
}

From source file:com.ewcms.common.query.cache.EhcacheResultCache.java

private Cache getCache() {
    Cache cache = cacheManager.getCache(cacheName);
    Assert.notNull(cache, "cache is null");
    return cache;
}

From source file:org.hoteia.qalingo.app.business.job.status.ServerStatusCleanerTasklet.java

public final void afterPropertiesSet() throws Exception {
    Assert.notNull(serverService, "You must provide an ServerService.");
}

From source file:de.itsvs.cwtrpc.core.pattern.DefaultPattern.java

public DefaultPattern(PatternMatcher<T> matcher, String pattern) {
    Assert.notNull(matcher, "'matcher' must not be null");
    Assert.notNull(pattern, "'pattern' must not be null");

    this.matcher = matcher;
    this.patternString = pattern;
    this.compiledPattern = matcher.compile(pattern);
}