Example usage for java.util Objects requireNonNull

List of usage examples for java.util Objects requireNonNull

Introduction

In this page you can find the example usage for java.util Objects requireNonNull.

Prototype

public static <T> T requireNonNull(T obj) 

Source Link

Document

Checks that the specified object reference is not null .

Usage

From source file:com.hpe.caf.worker.example.ExampleWorker.java

public ExampleWorker(final ExampleWorkerTask task, final DataStore dataStore, final String outputQueue,
        final Codec codec, final long resultSizeThreshold) throws InvalidTaskException {
    super(task, outputQueue, codec);
    this.dataStore = Objects.requireNonNull(dataStore);
    this.resultSizeThreshold = resultSizeThreshold;
}

From source file:com.avanza.ymer.MirroredObjectDefinition.java

public MirroredObjectDefinition(Class<T> mirroredType) {
    this.mirroredType = Objects.requireNonNull(mirroredType);
}

From source file:io.github.moosbusch.lumpi.application.spi.AbstractLumpiApplication.java

private LumpiApplicationContext initApplicationContext() {
    return Objects.requireNonNull(createApplicationContext());
}

From source file:com.diffplug.gradle.p2.P2BootstrapInstallation.java

P2BootstrapInstallation(EclipseRelease release) {
    this.release = Objects.requireNonNull(release);
    // install() will only work for officially supported versions
    Preconditions.checkArgument(SUPPORTED.contains(release), "We only have bootstrap for ", SUPPORTED);
}

From source file:org.eclipse.hono.service.credentials.CredentialsEndpoint.java

/**
 * Creates a new credentials endpoint for a vertx instance.
 *
 * @param vertx The vertx instance to use.
 *//*from   www .j a  v  a  2 s .co m*/
@Autowired
public CredentialsEndpoint(final Vertx vertx) {
    super(Objects.requireNonNull(vertx));
}

From source file:com.github.horrorho.inflatabledonkey.requests.AuthenticationRequestFactory.java

AuthenticationRequestFactory(String url, Map<Headers, Header> headers) {
    this.url = Objects.requireNonNull(url);
    this.headers = new HashMap<>(headers);
}

From source file:com.github.horrorho.inflatabledonkey.requests.AccountSettingsRequestFactory.java

AccountSettingsRequestFactory(String url, Map<Headers, Header> headers) {
    this.url = Objects.requireNonNull(url);
    this.headers = new HashMap<>(headers);
}

From source file:com.ait.tooling.server.core.json.binder.JSONBinder.java

@Override
public void send(final OutputStream stream, final Object object) throws ParserException {
    Objects.requireNonNull(object);

    try {/*from  w w w  . j  a va 2s .c  o  m*/
        if (object instanceof JSONObject) {
            ((JSONObject) object).writeJSONString(new OutputStreamWriter(stream), isStrict());
        } else {
            super.send(stream, object);
        }
    } catch (Exception e) {
        throw new ParserException(e);
    }
}

From source file:org.eclipse.hono.service.auth.delegating.AuthenticationServerClient.java

/**
 * Creates a client for a remote authentication server.
 * /* w w w  .  j  a  v  a2  s .c o  m*/
 * @param vertx The Vert.x instance to run on.
 * @param connectionFactory The factory.
 * @throws NullPointerException if any of the parameters is {@code null}.
 */
@Autowired
public AuthenticationServerClient(final Vertx vertx,
        @Qualifier(AuthenticationConstants.QUALIFIER_AUTHENTICATION) final ConnectionFactory connectionFactory) {

    this.vertx = Objects.requireNonNull(vertx);
    this.factory = Objects.requireNonNull(connectionFactory);
}