lemval
2012-01-31 1c30dad2115fc513791d8a5b292ad0f7d7b85749
commit | author | age
c89745 1 /*
JM 2  * Copyright 2012 gitblit.com.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package com.gitblit.utils;
17
18 import java.util.Collection;
19
20
21 /**
22  * Utility class for arrays and collections.
23  * 
24  * @author James Moger
25  * 
26  */
27 public class ArrayUtils {
28
11924d 29     public static boolean isEmpty(byte [] array) {
JM 30         return array == null || array.length == 0;
31     }
32     
c89745 33     public static boolean isEmpty(Object [] array) {
JM 34         return array == null || array.length == 0;
35     }
36     
37     public static boolean isEmpty(Collection<?> collection) {
38         return collection == null || collection.size() == 0;
39     }
40 }