Here you can find the source of assertArrayType(Object array)
Parameter | Description |
---|---|
array | asserted object |
Parameter | Description |
---|---|
IllegalArgumentException | if the object is not a array |
public static void assertArrayType(Object array) throws IllegalArgumentException
//package com.java2s; //License from project: Apache License public class Main { /**//from w w w.jav a2 s .co m * Assert the object is array or not * * @param array * asserted object * @throws IllegalArgumentException * if the object is not a array */ public static void assertArrayType(Object array) throws IllegalArgumentException { Class<?> type = array.getClass(); if (!type.isArray()) { String message = String.format("The argument is not an array object, its type is %s", type.getName()); throw new IllegalArgumentException(message); } } }