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

org.opentripplanner.util.AssertUtils Maven / Gradle / Ivy

There is a newer version: 2.5.0
Show newest version
package org.opentripplanner.util;

public class AssertUtils {

  /** Private constructor to prevent creation of this utility class */
  private AssertUtils() {}

  /**
   * Verify String value is NOT {@code null}, empty or only whitespace.
   * @throws IllegalArgumentException if given value is {@code null}, empty or only whitespace.
   */
  public static void assertHasValue(String value) {
    if(value == null || value.isBlank()) {
      throw new IllegalArgumentException("Value can not be null, empty or just whitespace: " +
          (value==null ? "null" : "'" + value + "'"));
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy