001// Generated by delombok at Sat Feb 25 17:58:34 UTC 2023
002package io.cui.tools.lang;
003
004/**
005 * Overladed methods to check the emptiness of given primitive arrays. With empty being defined as
006 * is the given elements are {@code null} or 0 == array.length
007 *
008 * @author Oliver Wolff
009 */
010public final class MoreArrays {
011    /**
012     * Simple check method for a {@code null} safe check of the emptiness of the given parameter.
013     *
014     * @param array to be checked, may be null
015     * @return {@code true} is the given elements are {@code null} or 0 == array.length
016     */
017    public static boolean isEmpty(byte[] array) {
018        return null == array || 0 == array.length;
019    }
020
021    /**
022     * Simple check method for a {@code null} safe check of the emptiness of the given parameter.
023     *
024     * @param array to be checked, may be null
025     * @return {@code true} is the given elements are {@code null} or 0 == array.length
026     */
027    public static boolean isEmpty(char[] array) {
028        return null == array || 0 == array.length;
029    }
030
031    /**
032     * Simple check method for a {@code null} safe check of the emptiness of the given parameter.
033     *
034     * @param array to be checked, may be null
035     * @return {@code true} is the given elements are {@code null} or 0 == array.length
036     */
037    public static boolean isEmpty(boolean[] array) {
038        return null == array || 0 == array.length;
039    }
040
041    /**
042     * Simple check method for a {@code null} safe check of the emptiness of the given parameter.
043     *
044     * @param array to be checked, may be null
045     * @return {@code true} is the given elements are {@code null} or 0 == array.length
046     */
047    public static boolean isEmpty(int[] array) {
048        return null == array || 0 == array.length;
049    }
050
051    /**
052     * Simple check method for a {@code null} safe check of the emptiness of the given parameter.
053     *
054     * @param array to be checked, may be null
055     * @return {@code true} is the given elements are {@code null} or 0 == array.length
056     */
057    public static boolean isEmpty(long[] array) {
058        return null == array || 0 == array.length;
059    }
060
061    /**
062     * Simple check method for a {@code null} safe check of the emptiness of the given parameter.
063     *
064     * @param array to be checked, may be null
065     * @return {@code true} is the given elements are {@code null} or 0 == array.length
066     */
067    public static boolean isEmpty(double[] array) {
068        return null == array || 0 == array.length;
069    }
070
071    /**
072     * Simple check method for a {@code null} safe check of the emptiness of the given parameter.
073     *
074     * @param array to be checked, may be null
075     * @return {@code true} is the given elements are {@code null} or 0 == array.length
076     */
077    public static boolean isEmpty(float[] array) {
078        return null == array || 0 == array.length;
079    }
080
081    /**
082     * Simple check method for a {@code null} safe check of the emptiness of the given parameter.
083     *
084     * @param array to be checked, may be null
085     * @return {@code true} is the given elements are {@code null} or 0 == array.length
086     */
087    public static boolean isEmpty(short[] array) {
088        return null == array || 0 == array.length;
089    }
090
091    @java.lang.SuppressWarnings("all")
092    @lombok.Generated
093    private MoreArrays() {
094        throw new java.lang.UnsupportedOperationException("This is a utility class and cannot be instantiated");
095    }
096}