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:com.azaptree.services.security.Credential.java

public Credential(final String name, final Object credential) {
    Assert.hasText(name, "name is required");
    Assert.notNull(credential, "credential is required");
    this.name = name;
    this.credential = credential;
    expiresOn = null;// w ww  .j  av a2 s.c  om
}

From source file:com.frank.search.solr.core.schema.SolrSchemaResolver.java

public SchemaDefinition resolveSchemaForEntity(SolrPersistentEntity<?> entity) {

    Assert.notNull(entity, "Schema cannot be resolved for 'null'.");

    final SchemaDefinition schemaDefinition = new SchemaDefinition(entity.getSolrCoreName());

    entity.doWithProperties(new PropertyHandler<SolrPersistentProperty>() {

        @Override//w  w w  .  j av a 2  s .  c  o m
        public void doWithPersistentProperty(SolrPersistentProperty persistentProperty) {

            SchemaDefinition.FieldDefinition fieldDefinition = createFieldDefinitionForProperty(
                    persistentProperty);
            if (fieldDefinition != null) {
                schemaDefinition.addFieldDefinition(fieldDefinition);
            }
        }
    });

    return schemaDefinition;
}

From source file:com.frank.search.solr.core.query.result.TermsResultPage.java

public final void addTermsResult(List<TermsFieldEntry> entries, Field field) {
    Assert.notNull(field, "Cannot add terms for 'null' field.");
    this.termsMap.put(new StringPageKey(field.getName()), entries);
}

From source file:siia.booking.integration.notifications.RelatedTripsHeaderEnricher.java

public List<Trip> relatedTripsForFlight(FlightNotification notification) {
    Assert.notNull(this.tripRepository, "tripRepository is required");
    return this.tripRepository.findTripsRelatedTo(notification.getFlight());
}

From source file:grails.plugin.cache.web.filter.CacheExpressionRootObject.java

public CacheExpressionRootObject(Collection<Cache> caches, Method method, Class<?> targetClass) {

    Assert.notNull(method, "Method is required");
    Assert.notNull(targetClass, "targetClass is required");
    this.method = method;
    this.targetClass = targetClass;
    this.caches = caches;
}

From source file:org.eclipse.swordfish.core.event.EventHandlerAdapter.java

public void handleEvent(org.osgi.service.event.Event event) {
    Assert.notNull(delegate, "The EventListener delegate must be supplied");
    Event swordfishEvent = (Event) event.getProperty(org.osgi.service.event.EventConstants.EVENT);
    Assert.notNull(swordfishEvent, "The swordfish event must be supplied");
    delegate.handleEvent((T) swordfishEvent);
}

From source file:com.oasisdigital.sdre.order.PartInitializer.java

/**
 * Creates two orders and persists them using the given {@link PartRepository}.
 * // w  w  w  . j a v  a 2  s. com
 * @param orderRepository must not be {@literal null}.
 */
@Autowired
public PartInitializer(PartRepository orderRepository) {

    Assert.notNull(orderRepository, "OrderRepository must not be null!");

    orderRepository.save(Arrays.asList(new Part("1234", "Couch", 1000), new Part("3455", "Chair", 45),
            new Part("5555", "jicodjcoc bookshelf", 0), new Part("7765", "jhih3diuhihiu3333", 34)));
}

From source file:gov.nih.nci.cabig.ctms.acegi.acls.dao.impl.EhCacheBasedAclCache.java

public EhCacheBasedAclCache(Cache cache) {
    Assert.notNull(cache, "Cache required");
    this.cache = cache;
}

From source file:org.zalando.spring.data.businesskey.config.AnnotationBusinessKeyConfiguration.java

public AnnotationBusinessKeyConfiguration(final AnnotationMetadata metadata,
        final Class<? extends Annotation> annotation) {

    Assert.notNull(metadata, "AnnotationMetadata must not be null!");
    Assert.notNull(annotation, "Annotation must not be null!");

    this.attributes = new AnnotationAttributes(metadata.getAnnotationAttributes(annotation.getName()));
}

From source file:org.zalando.stups.clients.consumer.TestConsumer.java

@PostConstruct
public void init() {
    Assert.notNull(kioFeignClient, "KioFeignClient should not be null");
}