common_code/src/main/java/com/xiongyingqi/utils/code/CodeBuilder.java
public CodeBuilder addInterface(Class<?> interfaceClass) {
        if (!interfaceClass.isInterface()) {
            System.out.println(interfaceClass + "不是接口类型！取消设为实现。");
            return this;
        }
        String simpleName = interfaceClass.getSimpleName();
        Package pkg = interfaceClass.getPackage();
        imports.add(pkg.getName() + "." + simpleName);// 导入包
        this.interfaces.add(simpleName);// 添加实现的接口
        return this;
    }
public CodeBuilder addInterface(Class<?> interfaceClass) {
        if (!interfaceClass.isInterface()) {
            System.out.println(interfaceClass + "不是接口类型！取消设为实现。");
            return this;
        }
        String simpleName = interfaceClass.getSimpleName();
        Package pkg = interfaceClass.getPackage();
        imports.add(pkg.getName() + "." + simpleName);// 导入包
        this.interfaces.add(simpleName);// 添加实现的接口
        return this;
    }
public CodeBuilder addInterface ( Class < ? > interfaceClass ) { if ( ! interfaceClass . isInterface ( ) ) { System . out . println ( interfaceClass + "不是接口类型！取消设为实现。"); return this ; } String simpleName = interfaceClass . getSimpleName ( ) ; Package pkg = interfaceClass . getPackage ( ) ; imports . add ( pkg . getName ( ) + "." + simpleName ) ; // 导入包 this . interfaces . add ( simpleName ) ; // 添加实现的接口 return this ; }
增加接口

@param interfaceClass
@return
增加接口