All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.quarkiverse.openfga.client.model.utils.Preconditions Maven / Gradle / Ivy

The newest version!
package io.quarkiverse.openfga.client.model.utils;

import java.util.Objects;

import javax.annotation.Nonnull;

public class Preconditions {

    public static  @Nonnull T parameterNonNull(@Nonnull T value, @Nonnull String name) {
        return Objects.requireNonNull(value, name + " parameter must not be null");
    }

    public static void oneOfNonNull(String message, Object... values) {
        for (Object value : values) {
            if (value != null) {
                return;
            }
        }
        throw new NullPointerException(message);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy