package com.jay.monitor.data.server.models.response;

import com.jay.monitor.data.server.models.entity.BackstageRoute;

/**
 * @describe ：路由数据
 * @Author ： liukx
 * @time ： 2019/3/1 - 10:25
 */
public class RouteDataResponse extends BackstageRoute {


    public RouteDataResponse() {
    }


    public RouteDataResponse(BackstageRoute backstageRouteEntity) {
        this.setUrl(backstageRouteEntity.getUrl());
        this.setAuthor(backstageRouteEntity.getAuthor());
        this.setMethod(backstageRouteEntity.getMethod());
        this.setProduces(backstageRouteEntity.getProduces());
        this.setConsumes(backstageRouteEntity.getConsumes());
        this.setRemark(backstageRouteEntity.getRemark());
    }

    @Override
    public int hashCode() {
        String hashString = getUrl() + getAuthor() + getMethod() + getProduces() + getConsumes() + getRemark();
        System.out.println(hashString.hashCode());
        return hashString.hashCode();
    }

    @Override
    public boolean equals(Object obj) {
        if (obj instanceof RouteDataResponse) {
            RouteDataResponse entity = (RouteDataResponse) obj;
            return entity.hashCode() == this.hashCode();
        }
        return super.equals(obj);
    }

    public static void main(String[] args) {


    }
}
