View Javadoc
1   /*
2    * Copyright 2019 the original author or authors.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.bremersee.xml.test.model.xml3;
18  
19  import java.util.Objects;
20  import jakarta.xml.bind.annotation.XmlAccessType;
21  import jakarta.xml.bind.annotation.XmlAccessorType;
22  import jakarta.xml.bind.annotation.XmlAttribute;
23  import jakarta.xml.bind.annotation.XmlRootElement;
24  import jakarta.xml.bind.annotation.XmlType;
25  
26  /**
27   * The company.
28   *
29   * @author Christian Bremer
30   */
31  @XmlRootElement(name = "company")
32  @XmlType(name = "companyType")
33  @XmlAccessorType(XmlAccessType.FIELD)
34  @SuppressWarnings("unused")
35  public class Company {
36  
37    @XmlAttribute
38    private String name;
39  
40    /**
41     * Gets name.
42     *
43     * @return the name
44     */
45    public String getName() {
46      return name;
47    }
48  
49    /**
50     * Sets name.
51     *
52     * @param name the name
53     */
54    public void setName(String name) {
55      this.name = name;
56    }
57  
58    @Override
59    public String toString() {
60      return "Company{"
61          + "name='" + name + '\''
62          + '}';
63    }
64  
65    @Override
66    public boolean equals(Object o) {
67      if (this == o) {
68        return true;
69      }
70      if (!(o instanceof Company)) {
71        return false;
72      }
73      Company company = (Company) o;
74      return Objects.equals(name, company.name);
75    }
76  
77    @Override
78    public int hashCode() {
79      return Objects.hash(name);
80    }
81  }