View Javadoc
1   /*
2    Licensed to the Apache Software Foundation (ASF) under one
3    or more contributor license agreements.  See the NOTICE file
4    distributed with this work for additional information
5    regarding copyright ownership.  The ASF licenses this file
6    to you under the Apache License, Version 2.0 (the
7    "License"); you may not use this file except in compliance
8    with the License.  You may obtain a copy of the License at
9    
10       http://www.apache.org/licenses/LICENSE-2.0
11   
12   Unless required by applicable law or agreed to in writing,
13   software distributed under the License is distributed on an
14   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   KIND, either express or implied.  See the License for the
16   specific language governing permissions and limitations
17   under the License.
18   =================== DO NOT EDIT THIS FILE ====================
19   Generated by Modello 2.4.0,
20   any modifications will be overwritten.
21   ==============================================================
22   */
23  
24  package org.apache.maven.model;
25  
26  /**
27   * Specifies the organization that produces this project.
28   * 
29   * @version $Revision$ $Date$
30   */
31  @SuppressWarnings( "all" )
32  public class Organization
33      implements java.io.Serializable, java.lang.Cloneable, org.apache.maven.model.InputLocationTracker
34  {
35  
36        //--------------------------/
37       //- Class/Member Variables -/
38      //--------------------------/
39  
40      /**
41       * The full name of the organization.
42       */
43      private String name;
44  
45      /**
46       * The URL to the organization's home page.
47       */
48      private String url;
49  
50      /**
51       * Field locations.
52       */
53      private java.util.Map<Object, InputLocation> locations;
54  
55      /**
56       * Field location.
57       */
58      private InputLocation location;
59  
60      /**
61       * Field nameLocation.
62       */
63      private InputLocation nameLocation;
64  
65      /**
66       * Field urlLocation.
67       */
68      private InputLocation urlLocation;
69  
70  
71        //-----------/
72       //- Methods -/
73      //-----------/
74  
75      /**
76       * Method clone.
77       * 
78       * @return Organization
79       */
80      public Organization clone()
81      {
82          try
83          {
84              Organization copy = (Organization) super.clone();
85  
86              if ( copy.locations != null )
87              {
88                  copy.locations = new java.util.LinkedHashMap( copy.locations );
89              }
90  
91              return copy;
92          }
93          catch ( java.lang.Exception ex )
94          {
95              throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
96                  + " does not support clone()" ).initCause( ex );
97          }
98      } //-- Organization clone()
99  
100     /**
101      * 
102      * 
103      * @param key a key object.
104      * @return InputLocation
105      */
106     public InputLocation getLocation( Object key )
107     {
108         if ( key instanceof String )
109         {
110             switch ( ( String ) key )
111             {
112                 case "" :
113                 {
114                     return this.location;
115                 }
116                 case "name" :
117                 {
118                     return nameLocation;
119                 }
120                 case "url" :
121                 {
122                     return urlLocation;
123                 }
124                 default :
125                 {
126                     return getOtherLocation( key );
127                 }
128                 }
129             }
130             else
131             {
132                 return getOtherLocation( key );
133             }
134     } //-- InputLocation getLocation( Object )
135 
136     /**
137      * Get the full name of the organization.
138      * 
139      * @return String
140      */
141     public String getName()
142     {
143         return this.name;
144     } //-- String getName()
145 
146     /**
147      * 
148      * 
149      * @param key a key object.
150      * @param location a location object.
151      */
152     public void setLocation( Object key, InputLocation location )
153     {
154         if ( key instanceof String )
155         {
156             switch ( ( String ) key )
157             {
158                 case "" :
159                 {
160                     this.location = location;
161                     return;
162                 }
163                 case "name" :
164                 {
165                     nameLocation = location;
166                     return;
167                 }
168                 case "url" :
169                 {
170                     urlLocation = location;
171                     return;
172                 }
173                 default :
174                 {
175                     setOtherLocation( key, location );
176                     return;
177                 }
178             }
179         }
180         else
181         {
182             setOtherLocation( key, location );
183         }
184     } //-- void setLocation( Object, InputLocation )
185 
186     /**
187      * 
188      * 
189      * @param key a key object.
190      * @param location a location object.
191      */
192     public void setOtherLocation( Object key, InputLocation location )
193     {
194         if ( location != null )
195         {
196             if ( this.locations == null )
197             {
198                 this.locations = new java.util.LinkedHashMap<Object, InputLocation>();
199             }
200             this.locations.put( key, location );
201         }
202     } //-- void setOtherLocation( Object, InputLocation )
203 
204     /**
205      * 
206      * 
207      * @param key a key object.
208      * @return InputLocation
209      */
210     private InputLocation getOtherLocation( Object key )
211     {
212         return ( locations != null ) ? locations.get( key ) : null;
213     } //-- InputLocation getOtherLocation( Object )
214 
215     /**
216      * Get the URL to the organization's home page.
217      * 
218      * @return String
219      */
220     public String getUrl()
221     {
222         return this.url;
223     } //-- String getUrl()
224 
225     /**
226      * Set the full name of the organization.
227      * 
228      * @param name a name object.
229      */
230     public void setName( String name )
231     {
232         this.name = name;
233     } //-- void setName( String )
234 
235     /**
236      * Set the URL to the organization's home page.
237      * 
238      * @param url a url object.
239      */
240     public void setUrl( String url )
241     {
242         this.url = url;
243     } //-- void setUrl( String )
244 
245     
246             
247     /**
248      * @see java.lang.Object#toString()
249      */
250     public String toString()
251     {
252         return "Organization {name=" + name + ", url=" + url + "}";
253     }
254             
255           
256 }