Here you can find the source of isEmpty(Object[] array)
Parameter | Description |
---|---|
array | The array to check |
public static boolean isEmpty(Object[] array)
//package com.java2s; /*! ****************************************************************************** * * Pentaho Data Integration/* w ww . j a v a 2s .c om*/ * * Copyright (C) 2002-2017 by Hitachi Vantara : http://www.pentaho.com * ******************************************************************************* * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ******************************************************************************/ import java.util.List; public class Main { /** * Check if the CharSequence supplied is empty. A CharSequence is empty when it is null or when the length is 0 * * @param val * The stringBuffer to check * @return true if the stringBuffer supplied is empty */ public static boolean isEmpty(CharSequence val) { return val == null || val.length() == 0; } /** * Check if the CharSequence array supplied is empty. A CharSequence array is empty when it is null or when the number of elements * is 0 * * @param strings * The string array to check * @return true if the string array supplied is empty */ public static boolean isEmpty(CharSequence[] strings) { return strings == null || strings.length == 0; } /** * Check if the array supplied is empty. An array is empty when it is null or when the length is 0 * * @param array * The array to check * @return true if the array supplied is empty */ public static boolean isEmpty(Object[] array) { return array == null || array.length == 0; } /** * Check if the list supplied is empty. An array is empty when it is null or when the length is 0 * * @param list * the list to check * @return true if the supplied list is empty */ public static boolean isEmpty(List<?> list) { return list == null || list.size() == 0; } }