Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
23637 amit.gupta 1
package com.spice.profitmandi.common.model;
2
 
24509 amit.gupta 3
import java.util.ArrayList;
4
import java.util.List;
5
 
6
import com.spice.profitmandi.common.enumuration.ReporticoParams;
26066 amit.gupta 7
import com.spice.profitmandi.common.enumuration.ReporticoProject;
24509 amit.gupta 8
 
23637 amit.gupta 9
public class ReporticoUrlInfo {
24509 amit.gupta 10
	@Override
11
	public int hashCode() {
12
		final int prime = 31;
13
		int result = 1;
14
		result = prime * result + ((description == null) ? 0 : description.hashCode());
26066 amit.gupta 15
		result = prime * result + ((paramsList == null) ? 0 : paramsList.hashCode());
16
		result = prime * result + ((reporticoProject == null) ? 0 : reporticoProject.hashCode());
24509 amit.gupta 17
		result = prime * result + ((title == null) ? 0 : title.hashCode());
18
		result = prime * result + ((url == null) ? 0 : url.hashCode());
19
		return result;
20
	}
21
 
22
	@Override
23
	public boolean equals(Object obj) {
24
		if (this == obj)
25
			return true;
26
		if (obj == null)
27
			return false;
28
		if (getClass() != obj.getClass())
29
			return false;
30
		ReporticoUrlInfo other = (ReporticoUrlInfo) obj;
31
		if (description == null) {
32
			if (other.description != null)
33
				return false;
34
		} else if (!description.equals(other.description))
35
			return false;
26066 amit.gupta 36
		if (paramsList == null) {
37
			if (other.paramsList != null)
38
				return false;
39
		} else if (!paramsList.equals(other.paramsList))
40
			return false;
41
		if (reporticoProject != other.reporticoProject)
42
			return false;
24509 amit.gupta 43
		if (title == null) {
44
			if (other.title != null)
45
				return false;
46
		} else if (!title.equals(other.title))
47
			return false;
48
		if (url == null) {
49
			if (other.url != null)
50
				return false;
51
		} else if (!url.equals(other.url))
52
			return false;
53
		return true;
54
	}
55
 
23637 amit.gupta 56
	private String url;
57
	private String title;
58
	private String description;
26066 amit.gupta 59
	private ReporticoProject reporticoProject;
60
	public ReporticoProject getReporticoProject() {
61
		return reporticoProject;
62
	}
24509 amit.gupta 63
 
26066 amit.gupta 64
	public void setReporticoProject(ReporticoProject reporticoProject) {
65
		this.reporticoProject = reporticoProject;
66
	}
67
 
68
	public void setParamsList(List<ReporticoParams> paramsList) {
69
		this.paramsList = paramsList;
70
	}
71
 
72
	private List<ReporticoParams> paramsList = null;
73
 
74
	public ReporticoUrlInfo addParam(String paramName, ReporticoParams.Type paramType, String paramDisplay) {
75
		if(paramsList == null) {
76
			paramsList = new ArrayList<>();
77
		}
78
		paramsList.add(new ReporticoParams(paramName, paramType, paramDisplay));
24509 amit.gupta 79
		return this;
80
	}
81
 
82
	/**
83
	 * @param url
84
	 * @param title
85
	 * @param description
86
	 */
26066 amit.gupta 87
	public ReporticoUrlInfo(ReporticoProject reporticoProject, String url, String title, String description) {
88
		super();
89
		this.url = url;
90
		this.title = title;
91
		this.description = description;
92
		this.reporticoProject = reporticoProject;
93
	}
94
 
23637 amit.gupta 95
	public ReporticoUrlInfo(String url, String title, String description) {
96
		super();
97
		this.url = url;
98
		this.title = title;
99
		this.description = description;
100
	}
24509 amit.gupta 101
 
102
	public List<ReporticoParams> getParamsList() {
103
		return paramsList;
104
	}
105
 
23637 amit.gupta 106
	@Override
107
	public String toString() {
26066 amit.gupta 108
		return "ReporticoUrlInfo [url=" + url + ", title=" + title + ", description=" + description
109
				+ ", reporticoProject=" + reporticoProject + ", paramsList=" + paramsList + "]";
23637 amit.gupta 110
	}
24509 amit.gupta 111
 
23637 amit.gupta 112
	public String getUrl() {
113
		return url;
114
	}
24509 amit.gupta 115
 
23637 amit.gupta 116
	public void setUrl(String url) {
117
		this.url = url;
118
	}
24509 amit.gupta 119
 
23637 amit.gupta 120
	public String getTitle() {
121
		return title;
122
	}
24509 amit.gupta 123
 
23637 amit.gupta 124
	public void setTitle(String title) {
125
		this.title = title;
126
	}
24509 amit.gupta 127
 
23637 amit.gupta 128
	public String getDescription() {
129
		return description;
130
	}
24509 amit.gupta 131
 
23637 amit.gupta 132
	public void setDescription(String description) {
133
		this.description = description;
134
	}
135
}