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, Supplier<String> messageSupplier) 

Source Link

Document

Checks that the specified object reference is not null and throws a customized NullPointerException if it is.

Usage

From source file:edu.usu.sdl.openstorefront.service.ReportServiceImpl.java

@Override
public Report queueReport(Report report) {
    Objects.requireNonNull(report, "Report is required");

    report.setReportId(persistenceService.generateId());
    report.setRunStatus(RunStatus.PENDING);
    report.populateBaseCreateFields();/*from w ww . j  av a  2s .  c  om*/
    report = persistenceService.persist(report);
    return report;
}

From source file:com.conwet.silbops.msg.UnsubscribeMsg.java

public UnsubscribeMsg(Subscription subscription) {

    super(MessageType.UNSUBSCRIBE);
    this.subscription = Objects.requireNonNull(subscription, "Subscription is null");
    this.uncovered = new HashSet<>();
}

From source file:com.navercorp.pinpoint.flink.dao.hbase.MemoryDao.java

public MemoryDao(HbaseTemplate2 hbaseTemplate2,
        ApplicationStatHbaseOperationFactory applicationStatHbaseOperationFactory,
        MemorySerializer memorySerializer, TableNameProvider tableNameProvider) {
    this.hbaseTemplate2 = Objects.requireNonNull(hbaseTemplate2, "hbaseTemplate2 must not be null");
    this.applicationStatHbaseOperationFactory = Objects.requireNonNull(applicationStatHbaseOperationFactory,
            "applicationStatHbaseOperationFactory must not be null");
    this.memorySerializer = Objects.requireNonNull(memorySerializer, "memorySerializer must not be null");
    this.tableNameProvider = Objects.requireNonNull(tableNameProvider, "tableNameProvider must not be null");
}

From source file:com.navercorp.pinpoint.flink.dao.hbase.CpuLoadDao.java

public CpuLoadDao(HbaseTemplate2 hbaseTemplate2,
        ApplicationStatHbaseOperationFactory applicationStatHbaseOperationFactory,
        CpuLoadSerializer cpuLoadSerializer, TableNameProvider tableNameProvider) {
    this.hbaseTemplate2 = Objects.requireNonNull(hbaseTemplate2, "hbaseTemplate2 must not be null");
    this.applicationStatHbaseOperationFactory = Objects.requireNonNull(applicationStatHbaseOperationFactory,
            "applicationStatHbaseOperationFactory must not be null");
    this.cpuLoadSerializer = Objects.requireNonNull(cpuLoadSerializer, "cpuLoadSerializer must not be null");
    this.tableNameProvider = Objects.requireNonNull(tableNameProvider, "tableNameProvider must not be null");
}

From source file:com.github.horrorho.inflatabledonkey.responsehandler.DelimitedProtobufHandler.java

public DelimitedProtobufHandler(IOFunction<InputStream, T> parse) {
    this.parse = Objects.requireNonNull(parse, "parse");
}

From source file:com.navercorp.pinpoint.flink.dao.hbase.DataSourceDao.java

public DataSourceDao(HbaseTemplate2 hbaseTemplate2,
        ApplicationStatHbaseOperationFactory applicationStatHbaseOperationFactory,
        DataSourceSerializer dataSourceSerializer, TableNameProvider tableNameProvider) {
    this.hbaseTemplate2 = Objects.requireNonNull(hbaseTemplate2, "hbaseTemplate2 must not be null");
    this.applicationStatHbaseOperationFactory = Objects.requireNonNull(applicationStatHbaseOperationFactory,
            "applicationStatHbaseOperationFactory must not be null");
    this.dataSourceSerializer = Objects.requireNonNull(dataSourceSerializer,
            "dataSourceSerializer must not be null");
    this.tableNameProvider = Objects.requireNonNull(tableNameProvider, "tableNameProvider must not be null");
}

From source file:org.apache.calcite.adapter.elasticsearch.ElasticsearchSchemaFactory.java

/**
 * Builds elastic rest client from user configuration
 * @param coordinates list of {@code hostname/port} to connect to
 * @return newly initialized low-level rest http client for ES
 *///from w  w  w  .ja v  a  2 s  .c  o  m
private static RestClient connect(Map<String, Integer> coordinates) {
    Objects.requireNonNull(coordinates, "coordinates");
    Preconditions.checkArgument(!coordinates.isEmpty(), "no ES coordinates specified");
    final Set<HttpHost> set = new LinkedHashSet<>();
    for (Map.Entry<String, Integer> entry : coordinates.entrySet()) {
        set.add(new HttpHost(entry.getKey(), entry.getValue()));
    }

    return RestClient.builder(set.toArray(new HttpHost[0])).build();
}

From source file:com.navercorp.pinpoint.flink.dao.hbase.ActiveTraceDao.java

public ActiveTraceDao(HbaseTemplate2 hbaseTemplate2,
        ApplicationStatHbaseOperationFactory applicationStatHbaseOperationFactory,
        ActiveTraceSerializer activeTraceSerializer, TableNameProvider tableNameProvider) {
    this.hbaseTemplate2 = Objects.requireNonNull(hbaseTemplate2, "hbaseTemplate2 must not be null");
    this.applicationStatHbaseOperationFactory = Objects.requireNonNull(applicationStatHbaseOperationFactory,
            "applicationStatHbaseOperationFactory must not be null");
    this.activeTraceSerializer = Objects.requireNonNull(activeTraceSerializer,
            "activeTraceSerializer must not be null");
    this.tableNameProvider = Objects.requireNonNull(tableNameProvider, "tableNameProvider must not be null");
}

From source file:com.navercorp.pinpoint.flink.dao.hbase.TransactionDao.java

public TransactionDao(HbaseTemplate2 hbaseTemplate2,
        ApplicationStatHbaseOperationFactory applicationStatHbaseOperationFactory,
        TransactionSerializer transactionSerializer, TableNameProvider tableNameProvider) {
    this.hbaseTemplate2 = Objects.requireNonNull(hbaseTemplate2, "hbaseTemplate2 must not be null");
    this.applicationStatHbaseOperationFactory = Objects.requireNonNull(applicationStatHbaseOperationFactory,
            "applicationStatHbaseOperationFactory must not be null");
    this.transactionSerializer = Objects.requireNonNull(transactionSerializer,
            "transactionSerializer must not be null");
    this.tableNameProvider = Objects.requireNonNull(tableNameProvider, "tableNameProvider must not be null");
}

From source file:com.navercorp.pinpoint.flink.dao.hbase.DirectBufferDao.java

public DirectBufferDao(HbaseTemplate2 hbaseTemplate2,
        ApplicationStatHbaseOperationFactory applicationStatHbaseOperationFactory,
        DirectBufferSerializer directBufferSerializer, TableNameProvider tableNameProvider) {
    this.hbaseTemplate2 = Objects.requireNonNull(hbaseTemplate2, "hbaseTemplate2 must not be null");
    this.applicationStatHbaseOperationFactory = Objects.requireNonNull(applicationStatHbaseOperationFactory,
            "applicationStatHbaseOperationFactory must not be null");
    this.directBufferSerializer = Objects.requireNonNull(directBufferSerializer,
            "directBufferSerializer must not be null");
    this.tableNameProvider = Objects.requireNonNull(tableNameProvider, "tableNameProvider must not be null");
}