Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
OfflineLink |
|
| 1.4444444444444444;1,444 |
1 | /* | |
2 | * $Id$ | |
3 | */ | |
4 | ||
5 | package org.apache.maven.plugin.javadoc.options; | |
6 | ||
7 | //---------------------------------/ | |
8 | //- Imported classes and packages -/ | |
9 | //---------------------------------/ | |
10 | ||
11 | import java.util.Date; | |
12 | ||
13 | /** | |
14 | * An offline link parameter. | |
15 | * | |
16 | * @version $Revision$ $Date$ | |
17 | */ | |
18 | 1 | public class OfflineLink implements java.io.Serializable { |
19 | ||
20 | ||
21 | //--------------------------/ | |
22 | //- Class/Member Variables -/ | |
23 | //--------------------------/ | |
24 | ||
25 | /** | |
26 | * The url of the link. | |
27 | */ | |
28 | private String url; | |
29 | ||
30 | /** | |
31 | * The location of the link. | |
32 | */ | |
33 | private String location; | |
34 | ||
35 | ||
36 | //-----------/ | |
37 | //- Methods -/ | |
38 | //-----------/ | |
39 | ||
40 | /** | |
41 | * Method equals. | |
42 | * | |
43 | * @param other | |
44 | * @return boolean | |
45 | */ | |
46 | public boolean equals(Object other) | |
47 | { | |
48 | 0 | if ( this == other) |
49 | { | |
50 | 0 | return true; |
51 | } | |
52 | ||
53 | 0 | if ( !(other instanceof OfflineLink) ) |
54 | { | |
55 | 0 | return false; |
56 | } | |
57 | ||
58 | 0 | OfflineLink that = (OfflineLink) other; |
59 | 0 | boolean result = true; |
60 | ||
61 | 0 | result = result && ( getUrl() == null ? that.getUrl() == null : getUrl().equals( that.getUrl() ) ); |
62 | 0 | result = result && ( getLocation() == null ? that.getLocation() == null : getLocation().equals( that.getLocation() ) ); |
63 | ||
64 | 0 | return result; |
65 | } //-- boolean equals(Object) | |
66 | ||
67 | /** | |
68 | * Get the location of the link. | |
69 | * | |
70 | * @return String | |
71 | */ | |
72 | public String getLocation() | |
73 | { | |
74 | 1 | return this.location; |
75 | } //-- String getLocation() | |
76 | ||
77 | /** | |
78 | * Get the url of the link. | |
79 | * | |
80 | * @return String | |
81 | */ | |
82 | public String getUrl() | |
83 | { | |
84 | 1 | return this.url; |
85 | } //-- String getUrl() | |
86 | ||
87 | /** | |
88 | * Method hashCode. | |
89 | * | |
90 | * @return int | |
91 | */ | |
92 | public int hashCode() | |
93 | { | |
94 | 0 | int result = 17; |
95 | ||
96 | 0 | result = 37 * result + ( url != null ? url.hashCode() : 0 ); |
97 | 0 | result = 37 * result + ( location != null ? location.hashCode() : 0 ); |
98 | ||
99 | 0 | return result; |
100 | } //-- int hashCode() | |
101 | ||
102 | /** | |
103 | * Set the location of the link. | |
104 | * | |
105 | * @param location | |
106 | */ | |
107 | public void setLocation(String location) | |
108 | { | |
109 | 1 | this.location = location; |
110 | 1 | } //-- void setLocation(String) |
111 | ||
112 | /** | |
113 | * Set the url of the link. | |
114 | * | |
115 | * @param url | |
116 | */ | |
117 | public void setUrl(String url) | |
118 | { | |
119 | 1 | this.url = url; |
120 | 1 | } //-- void setUrl(String) |
121 | ||
122 | /** | |
123 | * Method toString. | |
124 | * | |
125 | * @return java.lang.String | |
126 | */ | |
127 | public java.lang.String toString() | |
128 | { | |
129 | 0 | StringBuffer buf = new StringBuffer(); |
130 | ||
131 | 0 | buf.append( "url = '" ); |
132 | 0 | buf.append( getUrl() ); |
133 | 0 | buf.append( "'" ); |
134 | 0 | buf.append( "\n" ); |
135 | 0 | buf.append( "location = '" ); |
136 | 0 | buf.append( getLocation() ); |
137 | 0 | buf.append( "'" ); |
138 | ||
139 | 0 | return buf.toString(); |
140 | } //-- java.lang.String toString() | |
141 | ||
142 | ||
143 | 1 | private String modelEncoding = "UTF-8"; |
144 | ||
145 | /** | |
146 | * Set an encoding used for reading/writing the model. | |
147 | * | |
148 | * @param modelEncoding the encoding used when reading/writing the model. | |
149 | */ | |
150 | public void setModelEncoding( String modelEncoding ) | |
151 | { | |
152 | 0 | this.modelEncoding = modelEncoding; |
153 | 0 | } |
154 | ||
155 | /** | |
156 | * @return the current encoding used when reading/writing this model. | |
157 | */ | |
158 | public String getModelEncoding() | |
159 | { | |
160 | 0 | return modelEncoding; |
161 | } | |
162 | } |