This project has retired. For details please refer to its Attic page.
License xref
View Javadoc
1   package org.apache.archiva.metadata.model;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *   http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import javax.xml.bind.annotation.XmlRootElement;
23  import java.io.Serializable;
24  
25  /**
26   * A description of a particular license used by a project.
27   */
28  @XmlRootElement(name = "license")
29  public class License
30      implements Serializable
31  {
32      /**
33       * The name of the license.
34       */
35      private String name;
36  
37      /**
38       * The URL of the license text.
39       */
40      private String url;
41  
42      public License( String name, String url )
43      {
44          this.name = name;
45          this.url = url;
46      }
47  
48      public License()
49      {
50          // no op
51      }
52  
53      public String getName()
54      {
55          return name;
56      }
57  
58      public void setName( String name )
59      {
60          this.name = name;
61      }
62  
63      public String getUrl()
64      {
65          return url;
66      }
67  
68      public void setUrl( String url )
69      {
70          this.url = url;
71      }
72  
73      @Override
74      public boolean equals( Object o )
75      {
76          if ( this == o )
77          {
78              return true;
79          }
80          if ( o == null || getClass() != o.getClass() )
81          {
82              return false;
83          }
84  
85          License license = (License) o;
86  
87          if ( name != null ? !name.equals( license.name ) : license.name != null )
88          {
89              return false;
90          }
91          if ( url != null ? !url.equals( license.url ) : license.url != null )
92          {
93              return false;
94          }
95  
96          return true;
97      }
98  
99      @Override
100     public int hashCode()
101     {
102         int result = name != null ? name.hashCode() : 0;
103         result = 31 * result + ( url != null ? url.hashCode() : 0 );
104         return result;
105     }
106 
107     @Override
108     public String toString()
109     {
110         return "License{" + "name='" + name + '\'' + ", url='" + url + '\'' + '}';
111     }
112 }