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:io.github.retz.protocol.data.DockerVolume.java

@JsonCreator
public DockerVolume(@JsonProperty(value = "driver", required = true) String driver,
        @JsonProperty(value = "containerPath", required = true) String containerPath,
        @JsonProperty("mode") Mode mode, @JsonProperty(value = "name", required = true) String name,
        @JsonProperty("options") Properties options) {
    this.driver = Objects.requireNonNull(driver);
    this.containerPath = Objects.requireNonNull(containerPath);
    this.mode = (mode == null) ? Mode.RW : mode;
    this.name = Objects.requireNonNull(name);
    this.options = (options == null) ? new Properties() : options;
}

From source file:it.unibo.alchemist.language.protelis.util.ReflectionUtils.java

/**
 * @param methodName//from ww  w . ja  v  a2 s.  c o  m
 *            the method to be invoked
 * @param target
 *            the target object. It can not be null
 * @param args
 *            the arguments for the method
 * @return the result of the invocation, or an {@link IllegalStateException}
 *         if something goes wrong.
 */
public static Object invokeBestNotStatic(final Object target, final String methodName, final Object[] args) {
    Objects.requireNonNull(target);
    return invokeBestMethod(target.getClass(), methodName, target, args);
}

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

/**
 * Creates a new credentials endpoint for a vertx instance.
 *
 * @param vertx The vertx instance to use.
 *///w ww .  j ava2  s  .com
@Autowired
public CredentialsAmqpEndpoint(final Vertx vertx) {
    super(Objects.requireNonNull(vertx));
}

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

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

    try {//from  www .  j a v  a 2  s.co m
        if (object instanceof JSONObject) {
            final Writer writer = new FileWriter(file);

            ((JSONObject) object).writeJSONString(writer, isStrict());

            IOUtils.closeQuietly(writer);
        } else {
            super.send(file, object);
        }
    } catch (Exception e) {
        throw new ParserException(e);
    }
}

From source file:org.n52.iceland.statistics.api.utils.KibanaImporter.java

public KibanaImporter(Client client, String kibanaIndexName, String statisticsIndexName) {
    Objects.requireNonNull(client);
    Objects.requireNonNull(kibanaIndexName);
    Objects.requireNonNull(statisticsIndexName);

    this.kibanaIndexName = kibanaIndexName;
    this.statisticsIndexName = statisticsIndexName;
    this.client = client;
}

From source file:onl.area51.httpd.action.HttpFunction.java

default <V> HttpFunction<V, R> compose(HttpFunction<? super V, ? extends T> before) {
    Objects.requireNonNull(before);
    return (V v) -> apply(before.apply(v));
}

From source file:org.eclipse.hono.service.registration.RegistrationAmqpEndpoint.java

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

From source file:org.eclipse.hono.messaging.SenderFactoryImpl.java

/**
 * Sets the configuration properties.//from w w  w . j  ava  2  s  .  c o  m
 * 
 * @param config The configuration.
 * @throws NullPointerException if config is {@code null}.
 */
@Autowired(required = false)
public void setConfiguration(final HonoMessagingConfigProperties config) {
    this.config = Objects.requireNonNull(config);
}

From source file:com.spotify.hamcrest.jackson.IsJsonObject.java

private IsJsonObject(final LinkedHashMap<String, Matcher<? super JsonNode>> entryMatchers) {
    super(JsonNodeType.OBJECT);
    this.entryMatchers = Objects.requireNonNull(entryMatchers);
}

From source file:com.spotify.styx.api.StyxConfigResource.java

public StyxConfigResource(Storage storage) {
    this.storage = Objects.requireNonNull(storage);
}