View Javadoc

1   /**
2    * Project MI+
3    *
4    * Copyright (c) 2013, Syed Muhammad Humayun - smhumayun@gmail.com
5    *
6    * This project includes software developed by Syed Muhammad Humayun - smhumayun@gmail.com
7    * http://www.smhumayun.com
8    *
9    * Licensed under the Apache License, Version 2.0 (the
10   * "License"); you may not use this file except in compliance
11   * with the License. You may obtain a copy of the License at:
12   *
13   * http://www.apache.org/licenses/LICENSE-2.0
14   *
15   * Unless required by applicable law or agreed to in writing,
16   * software distributed under the License is distributed on
17   * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18   * KIND, either express or implied. See the License for the
19   * specific language governing permissions and limitations
20   * under the License.
21   */
22  package com.smhumayun.mi_plus.util;
23  
24  /**
25   * Utility class contain various utility methods used across api's implementation.
26   *
27   * @author smhumayun
28   * @since 1.0
29   */
30  public class Utils {
31  
32      /**
33       * Utility method to get array of classes against given set of <code>objects</code>
34       *
35       * @param objects array of objects
36       * @return array of classes against given set of <code>objects</code>
37       */
38      public Class[] getClasses (Object[] objects)
39      {
40          Class[] classes = null;
41          if(objects != null)
42          {
43              classes = new Class[objects.length];
44              for (int i = 0; i < objects.length; i++) {
45                  Object object = objects[i];
46                  classes[i] = object.getClass();
47              }
48          }
49          return classes;
50      }
51  
52  }