View Javadoc

1   /*
2    * $Id: EmailAddress.java 21889 2011-05-12 03:30:26Z dirk.olmes $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  package org.mule.jaxb.model;
11  
12  import javax.xml.bind.annotation.XmlAccessType;
13  import javax.xml.bind.annotation.XmlAccessorType;
14  import javax.xml.bind.annotation.XmlRootElement;
15  
16  /**
17   * TODO
18   */
19  @XmlRootElement(name = "emailAddress")
20  @XmlAccessorType(XmlAccessType.FIELD)
21  public class EmailAddress
22  {
23      private String type;
24      private String address;
25  
26      public EmailAddress()
27      {
28          super();
29      }
30  
31      public EmailAddress(String address, String type)
32      {
33          super();
34          this.address = address;
35          this.type = type;
36      }
37  
38      public String getType()
39      {
40          return type;
41      }
42  
43      public void setType(String type)
44      {
45          this.type = type;
46      }
47  
48      public String getAddress()
49      {
50          return address;
51      }
52  
53      public void setAddress(String address)
54      {
55          this.address = address;
56      }
57  
58      @Override
59      public boolean equals(Object o)
60      {
61          if (this == o)
62          {
63              return true;
64          }
65          if (o == null || getClass() != o.getClass())
66          {
67              return false;
68          }
69  
70          EmailAddress that = (EmailAddress) o;
71  
72          if (address != null ? !address.equals(that.address) : that.address != null)
73          {
74              return false;
75          }
76          if (type != null ? !type.equals(that.type) : that.type != null)
77          {
78              return false;
79          }
80  
81          return true;
82      }
83  
84      @Override
85      public int hashCode()
86      {
87          int result = type != null ? type.hashCode() : 0;
88          result = 31 * result + (address != null ? address.hashCode() : 0);
89          return result;
90      }
91  }