001// =================== DO NOT EDIT THIS FILE ==================== 002// Generated by Modello 1.8.1, 003// any modifications will be overwritten. 004// ============================================================== 005 006package org.apache.maven.doxia.document; 007 008/** 009 * A menu item. 010 * 011 * @version $Revision$ $Date$ 012 */ 013@SuppressWarnings( "all" ) 014public class DocumentTOCItem 015 implements java.io.Serializable 016{ 017 018 //--------------------------/ 019 //- Class/Member Variables -/ 020 //--------------------------/ 021 022 /** 023 * 024 * The name to use for the toc. 025 * 026 */ 027 private String name; 028 029 /** 030 * 031 * The ref to use for the item. 032 * 033 */ 034 private String ref; 035 036 /** 037 * 038 * Whether to show any child elements of a TOCItem, 039 * overriding 040 * the depth given in DocumentTOC. By default, all 041 * children 042 * are expanded up to the depth given in 043 * DocumentTOC. 044 * 045 */ 046 private boolean collapse = false; 047 048 /** 049 * Field items. 050 */ 051 private java.util.List<DocumentTOCItem> items; 052 053 054 //-----------/ 055 //- Methods -/ 056 //-----------/ 057 058 /** 059 * Method addItem. 060 * 061 * @param documentTOCItem 062 */ 063 public void addItem( DocumentTOCItem documentTOCItem ) 064 { 065 getItems().add( documentTOCItem ); 066 } //-- void addItem( DocumentTOCItem ) 067 068 /** 069 * Method equals. 070 * 071 * @param other 072 * @return boolean 073 */ 074 public boolean equals( Object other ) 075 { 076 if ( this == other ) 077 { 078 return true; 079 } 080 081 if ( !( other instanceof DocumentTOCItem ) ) 082 { 083 return false; 084 } 085 086 DocumentTOCItem that = (DocumentTOCItem) other; 087 boolean result = true; 088 089 result = result && ( getName() == null ? that.getName() == null : getName().equals( that.getName() ) ); 090 result = result && ( getRef() == null ? that.getRef() == null : getRef().equals( that.getRef() ) ); 091 result = result && collapse == that.collapse; 092 result = result && ( getItems() == null ? that.getItems() == null : getItems().equals( that.getItems() ) ); 093 094 return result; 095 } //-- boolean equals( Object ) 096 097 /** 098 * Method getItems. 099 * 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}