All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.wangjie.rapidrouter.compiler.util.ElementUtil Maven / Gradle / Ivy

There is a newer version: 2.0.0
Show newest version
package com.wangjie.rapidrouter.compiler.util;

import com.google.auto.common.MoreElements;

import java.util.List;

import javax.lang.model.element.VariableElement;

/**
 * Author: wangjie
 * Email: [email protected]
 * Date: 3/16/16.
 */
public class ElementUtil {
    /**
     * 两组参数类型相同
     */
    public static boolean deepSame(List _this, List _that) {
        if (null == _this && null == _that) {
            return true;
        }

        if (null == _this || null == _that) {
            return false;
        }

        if (_this.size() != _that.size()) {
            return false;
        }

        for (int i = 0, len = _this.size(); i < len; i++) {
            VariableElement _thisEle = _this.get(i);
            VariableElement _thatEle = _that.get(i);

            if (!MoreElements.asType(_thisEle).getQualifiedName().toString()
                    .equals(MoreElements.asType(_thatEle).getQualifiedName().toString())) {
                return false;
            }
        }

        return true;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy