- java.lang.Object
-
- org.jfree.pdf.util.Args
-
public class Args extends java.lang.Object
A utility class that performs checks for method argument validity.
-
-
Constructor Summary
Constructors Modifier Constructor Description private
Args()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
arrayMustHaveLength(int length, boolean[] array, java.lang.String ref)
Checks an array to ensure it has the correct length and throws anIllegalArgumentException
if it does not.static void
arrayMustHaveLength(int length, double[] array, java.lang.String ref)
Checks an array to ensure it has the correct length and throws anIllegalArgumentException
if it does not.static void
nullNotPermitted(java.lang.Object obj, java.lang.String ref)
Checks that an argument is non-null
and throws anIllegalArgumentException
otherwise.
-
-
-
Method Detail
-
nullNotPermitted
public static void nullNotPermitted(java.lang.Object obj, java.lang.String ref)
Checks that an argument is non-null
and throws anIllegalArgumentException
otherwise.- Parameters:
obj
- the object to check fornull
.ref
- the text name for the parameter (to include in the exception message).
-
arrayMustHaveLength
public static void arrayMustHaveLength(int length, boolean[] array, java.lang.String ref)
Checks an array to ensure it has the correct length and throws anIllegalArgumentException
if it does not.- Parameters:
length
- the required length.array
- the array to check.ref
- the text name of the array parameter (to include in the exception message).
-
arrayMustHaveLength
public static void arrayMustHaveLength(int length, double[] array, java.lang.String ref)
Checks an array to ensure it has the correct length and throws anIllegalArgumentException
if it does not.- Parameters:
length
- the required length.array
- the array to check.ref
- the text name of the array parameter (to include in the exception message).
-
-