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

com.ly.doc.model.dependency.ApiDependency Maven / Gradle / Ivy

Go to download

Smart-doc is a tool that supports both JAVA RESTFUL API and Apache Dubbo RPC interface document generation.

There is a newer version: 3.0.5
Show newest version
/*
 * Copyright (C) 2018-2023 smart-doc
 *
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you 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.ly.doc.model.dependency;

import java.util.List;
import java.util.Objects;
import java.util.List;

/**
 * @author Fio
 */
public class ApiDependency {

    /**
     * The endpoint class's full qualified name
     */
    private String clazz;

    /**
     * Derived class full qualified name if the entry point class is interface
     */
    private List derivedClazz;

    /**
     * Api methods in the entry point class
     */
    private List apis;

    public ApiDependency() {
    }

    public ApiDependency(String clazz, List derivedClazz, List apis) {
        this.clazz = clazz;
        this.derivedClazz = derivedClazz;
        this.apis = apis;
    }

    /**
     * Api method simple info
     */
    public static class ApiInfo {

        /**
         * Api method name
         */
        private String method;

        /**
         * Api method args
         */
        private List args;

        /**
         * Api method return,include the generics
         */
        private List returns;

        public ApiInfo() {
        }

        public ApiInfo(String method, List args, List returns) {
            this.method = method;
            this.args = args;
            this.returns = returns;
        }

        public String getMethod() {
            return method;
        }

        public void setMethod(String method) {
            this.method = method;
        }

        public List getArgs() {
            return args;
        }

        public void setArgs(List args) {
            this.args = args;
        }

        public List getReturns() {
            return returns;
        }

        public void setReturns(List returns) {
            this.returns = returns;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (!(o instanceof ApiInfo)) return false;
            ApiInfo apiInfo = (ApiInfo) o;
            return Objects.equals(method, apiInfo.method) && Objects.equals(args, apiInfo.args) && Objects.equals(returns, apiInfo.returns);
        }

        @Override
        public int hashCode() {
            return Objects.hash(method, args, returns);
        }
    }

    public String getClazz() {
        return clazz;
    }

    public void setClazz(String clazz) {
        this.clazz = clazz;
    }

    public List getDerivedClazz() {
        return derivedClazz;
    }

    public void setDerivedClazz(List derivedClazz) {
        this.derivedClazz = derivedClazz;
    }

    public List getApis() {
        return apis;
    }

    public void setApis(List apis) {
        this.apis = apis;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof ApiDependency)) return false;
        ApiDependency that = (ApiDependency) o;
        return Objects.equals(clazz, that.clazz) && Objects.equals(derivedClazz, that.derivedClazz) && Objects.equals(apis, that.apis);
    }

    @Override
    public int hashCode() {
        return Objects.hash(clazz, derivedClazz, apis);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy