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

com.newrelic.telemetry.util.Utils Maven / Gradle / Ivy

/*
 * Copyright 2019 New Relic Corporation. All rights reserved.
 * SPDX-License-Identifier: Apache-2.0
 */
package com.newrelic.telemetry.util;

/** A class with helper functions */
public class Utils {

  public static  E verifyNonNull(E input, String message) throws IllegalArgumentException {
    if (input == null) {
      throw new IllegalArgumentException(message);
    }
    return input;
  }

  public static String verifyNonBlank(String input, String message)
      throws IllegalArgumentException {
    if (input == null || input.isEmpty()) {
      throw new IllegalArgumentException(message);
    }
    return input;
  }

  public static  E verifyNonNull(E input) throws IllegalArgumentException {
    return verifyNonNull(input, "input cannot be null");
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy