Module platform

Class Args

java.lang.Object
org.jfree.chart.util.Args

public class Args extends Object
A utility class for checking method arguments.
  • Constructor Details

    • Args

      public Args()
  • Method Details

    • nullNotPermitted

      public static void nullNotPermitted(Object param, String name)
      Throws an IllegalArgumentException if the supplied param is null.
      Parameters:
      param - the parameter to check (null permitted).
      name - the name of the parameter (to use in the exception message if param is null).
      Throws:
      IllegalArgumentException - if param is null.
    • requireNonNegative

      public static void requireNonNegative(int value, String name)
      Throws an IllegalArgumentException if value is negative.
      Parameters:
      value - the value.
      name - the parameter name (for use in the exception message).
    • requireNonNegative

      public static void requireNonNegative(double value, String name)
      Throws an IllegalArgumentException if value is negative.
      Parameters:
      value - the value.
      name - the parameter name (for use in the exception message).
    • requireInRange

      public static void requireInRange(int value, String name, int lowerBound, int upperBound)
      Checks that the value falls within the specified range and, if it does not, throws an IllegalArgumentException.
      Parameters:
      value - the value.
      name - the parameter name.
      lowerBound - the lower bound of the permitted range.
      upperBound - the upper bound fo the permitted range.