Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
RelationBean |
|
| 3.8;3.8 |
1 | // Copyright Aug 2, 2006 The Apache Software Foundation | |
2 | // | |
3 | // Licensed under the Apache License, Version 2.0 (the "License"); | |
4 | // you may not use this file except in compliance with the License. | |
5 | // You may obtain a copy of the License at | |
6 | // | |
7 | // http://www.apache.org/licenses/LICENSE-2.0 | |
8 | // | |
9 | // Unless required by applicable law or agreed to in writing, software | |
10 | // distributed under the License is distributed on an "AS IS" BASIS, | |
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
12 | // See the License for the specific language governing permissions and | |
13 | // limitations under the License. | |
14 | package org.apache.tapestry.html; | |
15 | ||
16 | /** | |
17 | * Defines a relationship between two documents. | |
18 | * | |
19 | * @author Andreas Andreou | |
20 | * @since 4.1.1 | |
21 | */ | |
22 | public class RelationBean | |
23 | { | |
24 | /** The target URL of the resource. */ | |
25 | private String _href; | |
26 | /** Specifies on what device the document will be displayed. */ | |
27 | private String _media; | |
28 | /** Defines the relationship between the current document and the targeted document. */ | |
29 | private String _rel; | |
30 | /** Defines the relationship between the targeted document and the current document. */ | |
31 | private String _rev; | |
32 | /** Specifies the MIME type of the target URL. */ | |
33 | private String _type; | |
34 | /** Title of the relation. */ | |
35 | private String _title; | |
36 | ||
37 | public RelationBean() | |
38 | 0 | { |
39 | 0 | } |
40 | ||
41 | public String getHref() | |
42 | { | |
43 | 0 | return _href; |
44 | } | |
45 | ||
46 | public void setHref(String href) | |
47 | { | |
48 | 0 | _href = href; |
49 | 0 | } |
50 | ||
51 | public String getMedia() | |
52 | { | |
53 | 0 | return _media; |
54 | } | |
55 | ||
56 | public void setMedia(String media) | |
57 | { | |
58 | 0 | _media = media; |
59 | 0 | } |
60 | ||
61 | public String getRel() | |
62 | { | |
63 | 0 | return _rel; |
64 | } | |
65 | ||
66 | public void setRel(String rel) | |
67 | { | |
68 | 0 | _rel = rel; |
69 | 0 | } |
70 | ||
71 | public String getRev() | |
72 | { | |
73 | 0 | return _rev; |
74 | } | |
75 | ||
76 | public void setRev(String rev) | |
77 | { | |
78 | 0 | _rev = rev; |
79 | 0 | } |
80 | ||
81 | public String getType() | |
82 | { | |
83 | 0 | return _type; |
84 | } | |
85 | ||
86 | public void setType(String type) | |
87 | { | |
88 | 0 | _type = type; |
89 | 0 | } |
90 | ||
91 | public String getTitle() | |
92 | { | |
93 | 0 | return _title; |
94 | } | |
95 | ||
96 | public void setTitle(String title) | |
97 | { | |
98 | 0 | _title = title; |
99 | 0 | } |
100 | ||
101 | public int hashCode() | |
102 | { | |
103 | 0 | final int prime = 31; |
104 | 0 | int result = 1; |
105 | 0 | result = prime * result + ((_href == null) ? 0 : _href.hashCode()); |
106 | 0 | result = prime * result + ((_media == null) ? 0 : _media.hashCode()); |
107 | 0 | result = prime * result + ((_rel == null) ? 0 : _rel.hashCode()); |
108 | 0 | result = prime * result + ((_rev == null) ? 0 : _rev.hashCode()); |
109 | 0 | result = prime * result + ((_title == null) ? 0 : _title.hashCode()); |
110 | 0 | result = prime * result + ((_type == null) ? 0 : _type.hashCode()); |
111 | 0 | return result; |
112 | } | |
113 | ||
114 | public boolean equals(Object obj) | |
115 | { | |
116 | 0 | if (this == obj) return true; |
117 | 0 | if (obj == null) return false; |
118 | 0 | if (getClass() != obj.getClass()) return false; |
119 | 0 | final RelationBean other = (RelationBean) obj; |
120 | 0 | if (_href == null) { |
121 | 0 | if (other._href != null) return false; |
122 | 0 | } else if (!_href.equals(other._href)) return false; |
123 | 0 | if (_media == null) { |
124 | 0 | if (other._media != null) return false; |
125 | 0 | } else if (!_media.equals(other._media)) return false; |
126 | 0 | if (_rel == null) { |
127 | 0 | if (other._rel != null) return false; |
128 | 0 | } else if (!_rel.equals(other._rel)) return false; |
129 | 0 | if (_rev == null) { |
130 | 0 | if (other._rev != null) return false; |
131 | 0 | } else if (!_rev.equals(other._rev)) return false; |
132 | 0 | if (_title == null) { |
133 | 0 | if (other._title != null) return false; |
134 | 0 | } else if (!_title.equals(other._title)) return false; |
135 | 0 | if (_type == null) { |
136 | 0 | if (other._type != null) return false; |
137 | 0 | } else if (!_type.equals(other._type)) return false; |
138 | 0 | return true; |
139 | } | |
140 | ||
141 | ||
142 | } |