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:de.itsvs.cwtrpc.controller.PreparedRemoteServiceConfig.java

public PreparedRemoteServiceConfig(String serviceName, Class<?> serviceInterface,
        boolean responseCompressionEnabled, RpcTokenValidator rpcTokenValidator) {
    Assert.hasText(serviceName, "'serviceName' must not be empty");
    Assert.notNull(serviceInterface, "'serviceInterface' must not be null");

    if (!serviceInterface.isInterface()) {
        throw new IllegalArgumentException("'serviceInterface' must be an interface");
    }/*from w  ww.j  a v a2  s .  c  o  m*/

    this.serviceName = serviceName;
    this.serviceInterface = serviceInterface;
    this.responseCompressionEnabled = responseCompressionEnabled;
    this.rpcTokenValidator = rpcTokenValidator;
}

From source file:org.springmodules.validation.util.condition.collection.AbstractCollectionElementCondition.java

/**
 * Constructs a new AbstractCollectionElementCondition with a given element elementCondition.
 *
 * @param elementCondition The element elementCondition.
 *///from ww  w . j av a  2  s .co  m
protected AbstractCollectionElementCondition(Condition elementCondition) {
    Assert.notNull(elementCondition, "Element condition cannot be null");
    this.elementCondition = elementCondition;
}

From source file:net.javacrumbs.smock.common.server.MockWebServiceClientResponseActions.java

public MockWebServiceClientResponseActions(MessageContext messageContext) {
    Assert.notNull(messageContext, "'messageContext' must not be null");
    this.messageContext = messageContext;
}

From source file:org.cloudfoundry.client.lib.archive.DirectoryApplicationArchive.java

public DirectoryApplicationArchive(File directory) {
    Assert.notNull(directory, "Directory must not be null");
    Assert.isTrue(directory.isDirectory(), "File must reference a directory");
    this.directory = directory;
    List<Entry> entries = new ArrayList<Entry>();
    collectEntries(entries, directory);/*from   www  . j a va2  s  .  co m*/
    this.entries = Collections.unmodifiableList(entries);
}

From source file:org.xmatthew.spy2servers.thread.ComponentInvokeTask.java

public boolean executed() {
    Assert.notNull(component, "component is null");
    try {/* ww w  .  ja  v a 2  s .com*/
        component.startup();
        return true;
    } catch (Exception e) {
        LOGGER.error(e.getMessage(), e);
        return false;
    }
}

From source file:org.springmodules.validation.util.condition.date.IsAfterDateCondition.java

/**
 * Constructs a new IsAfterDateCondition with a given date to be compared with the checked calendar.
 *
 * @param earlier The date to be compared with the checked calendar.
 *///from   w  ww.j  av a  2  s  . c o m
public IsAfterDateCondition(Date earlier) {
    Assert.notNull(earlier, "IsAfterDateCondition cannot be initialized with a null date");
    this.earlier = Calendar.getInstance();
    this.earlier.setTime(earlier);
}

From source file:org.oncoblocks.centromere.web.exceptions.RestError.java

public RestError(HttpStatus status, Integer code, String message, String developerMessage, String moreInfoUrl) {
    Assert.notNull(status, "HttpStatus argument cannot be null.");
    this.status = status;
    this.code = code;
    this.message = message;
    this.developerMessage = developerMessage;
    this.moreInfoUrl = moreInfoUrl;
}

From source file:com.azaptree.services.command.impl.CommandExcecutionMetric.java

public CommandExcecutionMetric(final CommandKey key) {
    Assert.notNull(key, "key is required");
    this.key = key;
    executionTimeStart = System.currentTimeMillis();
}

From source file:org.apache.zeppelin.lens.LensSimpleExecutionStrategy.java

public Object execute(ParseResult parseResult) throws RuntimeException {
    Assert.notNull(parseResult, "Parse result required");
    logger.info("LensSimpleExecutionStrategy execute method invoked");
    synchronized (this) {
        Assert.isTrue(isReadyForCommands(), "SimpleExecutionStrategy not yet ready for commands");
        Object target = parseResult.getInstance();
        if (target instanceof ExecutionProcessor) {
            ExecutionProcessor processor = ((ExecutionProcessor) target);
            parseResult = processor.beforeInvocation(parseResult);
            try {
                Object result = invoke(parseResult);
                processor.afterReturningInvocation(parseResult, result);
                return result;
            } catch (Throwable th) {
                processor.afterThrowingInvocation(parseResult, th);
                return handleThrowable(th);
            }// w  w  w .  ja  va2  s .  co m
        } else {
            return invoke(parseResult);
        }
    }
}