com.sunchenbin.store.feilong.core.lang.ObjectUtil.java Source code

Java tutorial

Introduction

Here is the source code for com.sunchenbin.store.feilong.core.lang.ObjectUtil.java

Source

/*
 * Copyright (C) 2008 feilong
 *
 * 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.
 */
package com.sunchenbin.store.feilong.core.lang;

/**
 * {@link Object} .
 * 
 * <h3></h3>
 * 
 * <blockquote>
 * <ol>
 * <li>{@link org.apache.commons.lang3.ObjectUtils#equals(Object, Object)} ?null</li>
 * </ol>
 * </blockquote>
 *
 * @author feilong
 * @version 1.0.0 2010-4-5 ?11:00:54
 * @see org.apache.commons.lang3.ObjectUtils
 * @since 1.0.0
 */
public final class ObjectUtil {

    /** Don't let anyone instantiate this class. */
    private ObjectUtil() {
        //AssertionError?. ?????. ???.
        //see Effective Java 2nd
        throw new AssertionError("No " + getClass().getName() + " instances for you!");
    }

    /**
     * ?boolean?.
     * 
     * @param object
     *            
     * @return true
     */
    public static Boolean isBoolean(Object object) {
        return object instanceof Boolean;
    }

    /**
     * ?Integer.
     * 
     * @param object
     *            
     * @return true
     */
    public static Boolean isInteger(Object object) {
        return object instanceof Integer;
    }

    /**
     * ?.
     *
     * @param object
     *            the object
     * @return true, if checks if is array
     * @since 1.3.0
     */
    public static Boolean isArray(Object object) {
        return object.getClass().isArray();
    }
}