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