Wednesday, September 9, 2015

Java Arrays Utility

public class Arrayz {

    /**
     * Returns true if the array passed is {@code null} or has no elements
     *
     * @param array a nullable array to be checked
     * @return true if array is null or has no elements
     */
    public static <T> boolean isNullOrEmpty(T...array) {
        return array == null || array.length == 0;
    }
}

No comments:

Post a Comment

Scrum and Scrum master

Scrum  Scrum is a framework which helps a team to work together.  It is like a rugby team (the scrum name comes from rugby game). Scrum enco...