Subversion Repositories SmartDukaan

Rev

Rev 24509 | Blame | Compare with Previous | Last modification | View Log | RSS feed

package com.spice.profitmandi.common.model;

import java.util.ArrayList;
import java.util.List;

import com.spice.profitmandi.common.enumuration.ReporticoParams;
import com.spice.profitmandi.common.enumuration.ReporticoProject;

public class ReporticoUrlInfo {
        @Override
        public int hashCode() {
                final int prime = 31;
                int result = 1;
                result = prime * result + ((description == null) ? 0 : description.hashCode());
                result = prime * result + ((paramsList == null) ? 0 : paramsList.hashCode());
                result = prime * result + ((reporticoProject == null) ? 0 : reporticoProject.hashCode());
                result = prime * result + ((title == null) ? 0 : title.hashCode());
                result = prime * result + ((url == null) ? 0 : url.hashCode());
                return result;
        }

        @Override
        public boolean equals(Object obj) {
                if (this == obj)
                        return true;
                if (obj == null)
                        return false;
                if (getClass() != obj.getClass())
                        return false;
                ReporticoUrlInfo other = (ReporticoUrlInfo) obj;
                if (description == null) {
                        if (other.description != null)
                                return false;
                } else if (!description.equals(other.description))
                        return false;
                if (paramsList == null) {
                        if (other.paramsList != null)
                                return false;
                } else if (!paramsList.equals(other.paramsList))
                        return false;
                if (reporticoProject != other.reporticoProject)
                        return false;
                if (title == null) {
                        if (other.title != null)
                                return false;
                } else if (!title.equals(other.title))
                        return false;
                if (url == null) {
                        if (other.url != null)
                                return false;
                } else if (!url.equals(other.url))
                        return false;
                return true;
        }

        private String url;
        private String title;
        private String description;
        private ReporticoProject reporticoProject;
        public ReporticoProject getReporticoProject() {
                return reporticoProject;
        }

        public void setReporticoProject(ReporticoProject reporticoProject) {
                this.reporticoProject = reporticoProject;
        }

        public void setParamsList(List<ReporticoParams> paramsList) {
                this.paramsList = paramsList;
        }

        private List<ReporticoParams> paramsList = null;

        public ReporticoUrlInfo addParam(String paramName, ReporticoParams.Type paramType, String paramDisplay) {
                if(paramsList == null) {
                        paramsList = new ArrayList<>();
                }
                paramsList.add(new ReporticoParams(paramName, paramType, paramDisplay));
                return this;
        }

        /**
         * @param url
         * @param title
         * @param description
         */
        public ReporticoUrlInfo(ReporticoProject reporticoProject, String url, String title, String description) {
                super();
                this.url = url;
                this.title = title;
                this.description = description;
                this.reporticoProject = reporticoProject;
        }

        public ReporticoUrlInfo(String url, String title, String description) {
                super();
                this.url = url;
                this.title = title;
                this.description = description;
        }

        public List<ReporticoParams> getParamsList() {
                return paramsList;
        }

        @Override
        public String toString() {
                return "ReporticoUrlInfo [url=" + url + ", title=" + title + ", description=" + description
                                + ", reporticoProject=" + reporticoProject + ", paramsList=" + paramsList + "]";
        }

        public String getUrl() {
                return url;
        }

        public void setUrl(String url) {
                this.url = url;
        }

        public String getTitle() {
                return title;
        }

        public void setTitle(String title) {
                this.title = title;
        }

        public String getDescription() {
                return description;
        }

        public void setDescription(String description) {
                this.description = description;
        }
}