List of usage examples for org.springframework.util Assert notNull
public static void notNull(@Nullable Object object, Supplier<String> messageSupplier)
From source file:com.wavemaker.commons.io.FilteredIterator.java
/** * Create a new {@link FilteredIterator} instance. * //from w w w . ja v a 2 s . co m * @param sourceIterator the source iterator. */ public FilteredIterator(Iterator<E> sourceIterator) { Assert.notNull(sourceIterator, "SourceIterator must not be null"); this.sourceIterator = sourceIterator; }
From source file:com.wavemaker.commons.io.FilteredResources.java
private FilteredResources(Resources<T> resources, Type type, ResourceFilter... filters) { Assert.notNull(resources, "Resources must not be null"); Assert.notNull(filters, "Filters must not be null"); this.resources = resources; this.filters = filters; this.type = type; }
From source file:org.juiser.spring.security.core.userdetails.ForwardedUserDetails.java
public ForwardedUserDetails(User user, Collection<? extends GrantedAuthority> grantedAuthorities) { Assert.notNull(user, "User argument cannot be null."); Assert.hasText(user.getUsername(), "User username cannot be null or empty."); this.user = user; if (CollectionUtils.isEmpty(grantedAuthorities)) { this.grantedAuthorities = java.util.Collections.emptyList(); } else {//ww w .j a va 2s . c o m this.grantedAuthorities = java.util.Collections.unmodifiableCollection(grantedAuthorities); } }
From source file:com.luna.common.repository.RepositoryHelper.java
public static EntityManager getEntityManager() { Assert.notNull(entityManager, "entityManager must null, please see " + "[com.luna.common.repository.RepositoryHelper#setEntityManagerFactory]"); return entityManager; }
From source file:org.cloudfoundry.caldecott.server.tunnel.Tunnel.java
public Tunnel(TunnelId id, Destination destination) { Assert.notNull(id, "ID must not be null"); Assert.notNull(destination, "Destination must not be null"); this.id = id; this.destination = destination; }
From source file:org.springdata.ehcache.config.EhcacheTemplateFactoryBean.java
@Override public void afterPropertiesSet() { Assert.notNull(cacheManager, "CacheManager property must be set"); Assert.notNull(ehcacheConverter, "CacheConverter property must be set"); ehcacheTemplate = new EhcacheTemplate(cacheManager, ehcacheConverter); }
From source file:com.vaadin.spring.internal.UIID.java
public UIID(UI ui) { Assert.notNull(ui, "ui must not be null"); Assert.isTrue(ui.getUIId() > -1, "UIId of ui must not be -1"); this.uiId = ui.getUIId(); }
From source file:at.create.android.ffc.http.MockHttpInputMessage.java
public MockHttpInputMessage(byte[] contents) { Assert.notNull(contents, "'contents' must not be null"); this.body = new ByteArrayInputStream(contents); }
From source file:it.tai.repository.MongoHealthIndicator.java
public MongoHealthIndicator(MongoTemplate mongoTemplate) { Assert.notNull(mongoTemplate, "MongoTemplate must not be null"); this.mongoTemplate = mongoTemplate; }
From source file:org.springmodules.validation.util.condition.adapter.CommonsPredicateCondition.java
/** * Constructs a new CommonsPredicateCondition with a given predicate. * * @param predicate The given predicate. *//*ww w. ja v a 2s .c om*/ public CommonsPredicateCondition(Predicate predicate) { Assert.notNull(predicate, "Predicate cannot be null"); this.predicate = predicate; }