1package org.apache.archiva.metadata.model;
23/*4 * Licensed to the Apache Software Foundation (ASF) under one5 * or more contributor license agreements. See the NOTICE file6 * distributed with this work for additional information7 * regarding copyright ownership. The ASF licenses this file8 * to you under the Apache License, Version 2.0 (the9 * "License"); you may not use this file except in compliance10 * with the License. You may obtain a copy of the License at11 *12 * http://www.apache.org/licenses/LICENSE-2.013 *14 * Unless required by applicable law or agreed to in writing,15 * software distributed under the License is distributed on an16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY17 * KIND, either express or implied. See the License for the18 * specific language governing permissions and limitations19 * under the License.20 */2122import javax.xml.bind.annotation.XmlRootElement;
23import java.io.Serializable;
2425/**26 * A description of a particular license used by a project.27 */28 @XmlRootElement(name = "license")
29publicclassLicense30implements Serializable
31 {
32/**33 * The name of the license.34 */35private String name;
3637/**38 * The URL of the license text.39 */40private String url;
4142publicLicense( String name, String url )
43 {
44this.name = name;
45this.url = url;
46 }
4748publicLicense()
49 {
50// no op51 }
5253public String getName()
54 {
55return name;
56 }
5758publicvoid setName( String name )
59 {
60this.name = name;
61 }
6263public String getUrl()
64 {
65return url;
66 }
6768publicvoid setUrl( String url )
69 {
70this.url = url;
71 }
7273 @Override
74publicboolean equals( Object o )
75 {
76if ( this == o )
77 {
78returntrue;
79 }
80if ( o == null || getClass() != o.getClass() )
81 {
82return false;
83 }
8485License license = (License) o;
8687if ( name != null ? !name.equals( license.name ) : license.name != null )
88 {
89return false;
90 }
91if ( url != null ? !url.equals( license.url ) : license.url != null )
92 {
93return false;
94 }
9596returntrue;
97 }
9899 @Override
100publicint hashCode()
101 {
102int result = name != null ? name.hashCode() : 0;
103 result = 31 * result + ( url != null ? url.hashCode() : 0 );
104return result;
105 }
106107 @Override
108public String toString()
109 {
110return"License{" + "name='" + name + '\'' + ", url='" + url + '\'' + '}';
111 }
112 }