Skip to content

Package: Address

Address

nameinstructionbranchcomplexitylinemethod
Address()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%

Coverage

1: /*
2: * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved.
3: *
4: * This program and the accompanying materials are made available under the
5: * terms of the Eclipse Public License v. 2.0, which is available at
6: * http://www.eclipse.org/legal/epl-2.0.
7: *
8: * This Source Code may also be made available under the following Secondary
9: * Licenses when the conditions for such availability set forth in the
10: * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11: * version 2 with the GNU Classpath Exception, which is available at
12: * https://www.gnu.org/software/classpath/license.html.
13: *
14: * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15: */
16:
17: package jakarta.mail;
18:
19: import java.io.Serializable;
20:
21: /**
22: * This abstract class models the addresses in a message.
23: * Subclasses provide specific implementations. Subclasses
24: * will typically be serializable so that (for example) the
25: * use of Address objects in search terms can be serialized
26: * along with the search terms.
27: *
28: * @author John Mani
29: * @author Bill Shannon
30: */
31:
32: public abstract class Address implements Serializable {
33:
34: private static final long serialVersionUID = -5822459626751992278L;
35:
36: /**
37: * Creates a default {@code Address}.
38: */
39: public Address() {
40: }
41:
42: /**
43: * Return a type string that identifies this address type.
44: *
45: * @return address type
46: * @see jakarta.mail.internet.InternetAddress
47: */
48: public abstract String getType();
49:
50: /**
51: * Return a String representation of this address object.
52: *
53: * @return string representation of this address
54: */
55: @Override
56: public abstract String toString();
57:
58: /**
59: * The equality operator. Subclasses should provide an
60: * implementation of this method that supports value equality
61: * (do the two Address objects represent the same destination?),
62: * not object reference equality. A subclass must also provide
63: * a corresponding implementation of the <code>hashCode</code>
64: * method that preserves the general contract of
65: * <code>equals</code> and <code>hashCode</code> - objects that
66: * compare as equal must have the same hashCode.
67: *
68: * @param address Address object
69: */
70: @Override
71: public abstract boolean equals(Object address);
72: }