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.frank.search.solr.core.query.AbstractQueryDecorator.java

public AbstractQueryDecorator(Query query) {

    Assert.notNull(query, "query must not be null");
    this.query = query;
}

From source file:am.ik.categolj2.api.MediaTypeResolver.java

public MediaType resolveFromExtension(String extension) {
    Assert.notNull(extension, "extension must not be null");
    MediaType mediaType = super.lookupMediaType(extension.toLowerCase(Locale.ENGLISH));
    if (mediaType == null) {
        mediaType = fallbackMediaType;/*from ww w .  j ava2 s . co m*/
    }
    return mediaType;
}

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

public DefaultGreenplumLoad(LoadConfiguration loadConfiguration, LoadService loadService) {
    this.loadConfiguration = loadConfiguration;
    this.loadService = loadService;
    Assert.notNull(loadConfiguration, "Load configuration must be set");
    Assert.notNull(loadService, "Load service must be set");
}

From source file:com.wavemaker.commons.io.JailedResourcePath.java

/**
 * Create a new {@link JailedResourcePath} instance.
 * /* w  ww .  j  a v a2  s .  co m*/
 * @param jailPath the jail path
 * @param path the path
 */
public JailedResourcePath(ResourcePath jailPath, ResourcePath path) {
    Assert.notNull(jailPath, "JailPath must not be null");
    Assert.notNull(path, "Path must not be null");
    this.path = path;
    this.jailPath = jailPath;
}

From source file:com.epam.cme.facades.converters.populator.SearchProductReviewPopulator.java

@Override
public void populate(final SearchResultValueData source, final ProductData target) {
    Assert.notNull(source, "Parameter source cannot be null.");
    Assert.notNull(target, "Parameter target cannot be null.");
    // Pull the values directly from the SearchResult object
    target.setNumberOfReviews(this.<Integer>getValue(source, "numberOfReviews"));
}

From source file:org.apache.mina.springrpc.MinaServerHandler.java

public MinaServerHandler(ReturnAddressAwareRemoteInvocationHandler remoteInvocationInvoker) {
    Assert.notNull(remoteInvocationInvoker, "remoteInvocationInvoker required");
    this.invocationHandler = remoteInvocationInvoker;
}

From source file:org.jdal.remoting.ReferenceInvocationExecutor.java

/**
 * {@inheritDoc}/*from   www. j a  va 2  s. c  o m*/
 */
public Object invoke(RemoteInvocation invocation, Object targetObject)
        throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
    Assert.notNull(invocation, "RemoteInvocation must not be null");
    Assert.notNull(targetObject, "Target object must not be null");
    // replace references with clients.
    Object[] arguments = invocation.getArguments();
    for (int i = 0; i < arguments.length; i++) {
        if (arguments[i] instanceof RemoteReference) {
            arguments[i] = ((RemoteReference) arguments[i]).createRemoteClient();
        }
    }
    return invocation.invoke(targetObject);
}

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

/** Protected constructor. Use the factory. */
protected AbstractMessage(final IUserAction userAction) {
    super();/* w ww.j  a  v a 2 s  .  co  m*/

    Assert.notNull(userAction, "No IUserAction provided !");

    this.userAction = userAction;
}

From source file:com.carlomicieli.jtrains.test.ValidationResult.java

private ValidationResult(Set<ConstraintViolation<T>> errors) {
    Assert.notNull(errors, "ValidationResult: errors is null");
    this.errors = errors;
}

From source file:grails.plugin.searchable.internal.compass.converter.DefaultCompassConverterLookupHelper.java

/**
 * Returns true if there is a registered Compass Converter for the given type
 * Also handles array types for supported array component types
 *
 * @param type a Class//from w  w w. j  a  va2 s  .com
 * @return true if a converter is available
 */
public boolean hasConverter(Class type) {
    Assert.notNull(converterLookup, "converterLookup cannot be null");
    Assert.notNull(type, "type cannot be null");
    if (type.isArray()) {
        type = type.getComponentType();
    }
    return converterLookup.lookupConverter(type) != null;
}