View Javadoc

1   /*
2    =================== DO NOT EDIT THIS FILE ====================
3    Generated by Modello 1.4.1 on 2012-04-13 21:28:13,
4    any modifications will be overwritten.
5    ==============================================================
6    */
7   
8   package org.apache.maven.doxia.document;
9   
10  /**
11   * A menu item.
12   * 
13   * @version $Revision$ $Date$
14   */
15  @SuppressWarnings( "all" )
16  public class DocumentTOCItem
17      implements java.io.Serializable
18  {
19  
20        //--------------------------/
21       //- Class/Member Variables -/
22      //--------------------------/
23  
24      /**
25       * 
26       *             The name to use for the toc.
27       *           
28       */
29      private String name;
30  
31      /**
32       * 
33       *             The ref to use for the item.
34       *           
35       */
36      private String ref;
37  
38      /**
39       * 
40       *            Whether to show any child elements of a TOCItem,
41       * overriding
42       *            the depth given in DocumentTOC. By default, all
43       * children
44       *            are expanded up to the depth given in
45       * DocumentTOC.
46       *           
47       */
48      private boolean collapse = false;
49  
50      /**
51       * Field items.
52       */
53      private java.util.List<DocumentTOCItem> items;
54  
55  
56        //-----------/
57       //- Methods -/
58      //-----------/
59  
60      /**
61       * Method addItem.
62       * 
63       * @param documentTOCItem
64       */
65      public void addItem( DocumentTOCItem documentTOCItem )
66      {
67          getItems().add( documentTOCItem );
68      } //-- void addItem( DocumentTOCItem )
69  
70      /**
71       * Method equals.
72       * 
73       * @param other
74       * @return boolean
75       */
76      public boolean equals( Object other )
77      {
78          if ( this == other )
79          {
80              return true;
81          }
82  
83          if ( !( other instanceof DocumentTOCItem ) )
84          {
85              return false;
86          }
87  
88          DocumentTOCItem that = (DocumentTOCItem) other;
89          boolean result = true;
90  
91          result = result && ( getName() == null ? that.getName() == null : getName().equals( that.getName() ) );
92          result = result && ( getRef() == null ? that.getRef() == null : getRef().equals( that.getRef() ) );
93          result = result && collapse == that.collapse;
94          result = result && ( getItems() == null ? that.getItems() == null : getItems().equals( that.getItems() ) );
95  
96          return result;
97      } //-- boolean equals( Object )
98  
99      /**
100      * Method getItems.
101      * 
102      * @return List
103      */
104     public java.util.List<DocumentTOCItem> getItems()
105     {
106         if ( this.items == null )
107         {
108             this.items = new java.util.ArrayList<DocumentTOCItem>();
109         }
110 
111         return this.items;
112     } //-- java.util.List<DocumentTOCItem> getItems()
113 
114     /**
115      * Get the name to use for the toc.
116      * 
117      * @return String
118      */
119     public String getName()
120     {
121         return this.name;
122     } //-- String getName()
123 
124     /**
125      * Get the ref to use for the item.
126      * 
127      * @return String
128      */
129     public String getRef()
130     {
131         return this.ref;
132     } //-- String getRef()
133 
134     /**
135      * Method hashCode.
136      * 
137      * @return int
138      */
139     public int hashCode()
140     {
141         int result = 17;
142 
143         result = 37 * result + ( name != null ? name.hashCode() : 0 );
144         result = 37 * result + ( ref != null ? ref.hashCode() : 0 );
145         result = 37 * result + ( collapse ? 0 : 1 );
146         result = 37 * result + ( items != null ? items.hashCode() : 0 );
147 
148         return result;
149     } //-- int hashCode()
150 
151     /**
152      * Get whether to show any child elements of a TOCItem,
153      * overriding
154      *            the depth given in DocumentTOC. By default, all
155      * children
156      *            are expanded up to the depth given in
157      * DocumentTOC.
158      * 
159      * @return boolean
160      */
161     public boolean isCollapse()
162     {
163         return this.collapse;
164     } //-- boolean isCollapse()
165 
166     /**
167      * Method removeItem.
168      * 
169      * @param documentTOCItem
170      */
171     public void removeItem( DocumentTOCItem documentTOCItem )
172     {
173         getItems().remove( documentTOCItem );
174     } //-- void removeItem( DocumentTOCItem )
175 
176     /**
177      * Set whether to show any child elements of a TOCItem,
178      * overriding
179      *            the depth given in DocumentTOC. By default, all
180      * children
181      *            are expanded up to the depth given in
182      * DocumentTOC.
183      * 
184      * @param collapse
185      */
186     public void setCollapse( boolean collapse )
187     {
188         this.collapse = collapse;
189     } //-- void setCollapse( boolean )
190 
191     /**
192      * Set a table of content item containing sub-items.
193      * 
194      * @param items
195      */
196     public void setItems( java.util.List<DocumentTOCItem> items )
197     {
198         this.items = items;
199     } //-- void setItems( java.util.List )
200 
201     /**
202      * Set the name to use for the toc.
203      * 
204      * @param name
205      */
206     public void setName( String name )
207     {
208         this.name = name;
209     } //-- void setName( String )
210 
211     /**
212      * Set the ref to use for the item.
213      * 
214      * @param ref
215      */
216     public void setRef( String ref )
217     {
218         this.ref = ref;
219     } //-- void setRef( String )
220 
221     /**
222      * Method toString.
223      * 
224      * @return String
225      */
226     public java.lang.String toString()
227     {
228         StringBuilder buf = new StringBuilder( 128 );
229 
230         buf.append( "name = '" );
231         buf.append( getName() );
232         buf.append( "'" );
233         buf.append( "\n" ); 
234         buf.append( "ref = '" );
235         buf.append( getRef() );
236         buf.append( "'" );
237         buf.append( "\n" ); 
238         buf.append( "collapse = '" );
239         buf.append( isCollapse() );
240         buf.append( "'" );
241         buf.append( "\n" ); 
242         buf.append( "items = '" );
243         buf.append( getItems() );
244         buf.append( "'" );
245 
246         return buf.toString();
247     } //-- java.lang.String toString()
248 
249 }