Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
DocumentTOCItem |
|
| 1.4444444444444444;1,444 |
1 | /* | |
2 | * $Id$ | |
3 | */ | |
4 | ||
5 | package org.apache.maven.doxia.docrenderer.document; | |
6 | ||
7 | //---------------------------------/ | |
8 | //- Imported classes and packages -/ | |
9 | //---------------------------------/ | |
10 | ||
11 | import java.util.Date; | |
12 | ||
13 | /** | |
14 | * A menu item. | |
15 | * | |
16 | * @version $Revision$ $Date$ | |
17 | */ | |
18 | 0 | public class DocumentTOCItem implements java.io.Serializable { |
19 | ||
20 | ||
21 | //--------------------------/ | |
22 | //- Class/Member Variables -/ | |
23 | //--------------------------/ | |
24 | ||
25 | /** | |
26 | * Field name | |
27 | */ | |
28 | private String name; | |
29 | ||
30 | /** | |
31 | * Field ref | |
32 | */ | |
33 | private String ref; | |
34 | ||
35 | ||
36 | //-----------/ | |
37 | //- Methods -/ | |
38 | //-----------/ | |
39 | ||
40 | /** | |
41 | * Method equals | |
42 | * | |
43 | * @param other | |
44 | */ | |
45 | public boolean equals(Object other) | |
46 | { | |
47 | 0 | if ( this == other) |
48 | { | |
49 | 0 | return true; |
50 | } | |
51 | ||
52 | 0 | if ( !(other instanceof DocumentTOCItem) ) |
53 | { | |
54 | 0 | return false; |
55 | } | |
56 | ||
57 | 0 | DocumentTOCItem that = (DocumentTOCItem) other; |
58 | 0 | boolean result = true; |
59 | 0 | result = result && ( getName() == null ? that.getName() == null : getName().equals( that.getName() ) ); |
60 | 0 | result = result && ( getRef() == null ? that.getRef() == null : getRef().equals( that.getRef() ) ); |
61 | 0 | return result; |
62 | } //-- boolean equals(Object) | |
63 | ||
64 | /** | |
65 | * Get The name to use for the toc. | |
66 | */ | |
67 | public String getName() | |
68 | { | |
69 | 0 | return this.name; |
70 | } //-- String getName() | |
71 | ||
72 | /** | |
73 | * Get The ref to use for the item. | |
74 | */ | |
75 | public String getRef() | |
76 | { | |
77 | 0 | return this.ref; |
78 | } //-- String getRef() | |
79 | ||
80 | /** | |
81 | * Method hashCode | |
82 | */ | |
83 | public int hashCode() | |
84 | { | |
85 | 0 | int result = 17; |
86 | long tmp; | |
87 | 0 | result = 37 * result + ( name != null ? name.hashCode() : 0 ); |
88 | 0 | result = 37 * result + ( ref != null ? ref.hashCode() : 0 ); |
89 | 0 | return result; |
90 | } //-- int hashCode() | |
91 | ||
92 | /** | |
93 | * Set The name to use for the toc. | |
94 | * | |
95 | * @param name | |
96 | */ | |
97 | public void setName(String name) | |
98 | { | |
99 | 0 | this.name = name; |
100 | 0 | } //-- void setName(String) |
101 | ||
102 | /** | |
103 | * Set The ref to use for the item. | |
104 | * | |
105 | * @param ref | |
106 | */ | |
107 | public void setRef(String ref) | |
108 | { | |
109 | 0 | this.ref = ref; |
110 | 0 | } //-- void setRef(String) |
111 | ||
112 | /** | |
113 | * Method toString | |
114 | */ | |
115 | public java.lang.String toString() | |
116 | { | |
117 | 0 | StringBuffer buf = new StringBuffer(); |
118 | 0 | buf.append( "name = '" ); |
119 | 0 | buf.append( getName() + "'" ); |
120 | 0 | buf.append( "\n" ); |
121 | 0 | buf.append( "ref = '" ); |
122 | 0 | buf.append( getRef() + "'" ); |
123 | 0 | return buf.toString(); |
124 | } //-- java.lang.String toString() | |
125 | ||
126 | ||
127 | 0 | private String modelEncoding = "UTF-8"; |
128 | ||
129 | public void setModelEncoding( String modelEncoding ) | |
130 | { | |
131 | 0 | this.modelEncoding = modelEncoding; |
132 | 0 | } |
133 | ||
134 | public String getModelEncoding() | |
135 | { | |
136 | 0 | return modelEncoding; |
137 | } | |
138 | } |