2 * Copyright 2009 Google Inc.
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 * use this file except in compliance with the License. You may obtain a copy of
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 * License for the specific language governing permissions and limitations under
16 package com
.google
.appengine
.api
.datastore
;
18 import java
.io
.Serializable
;
21 * An e-mail address datatype. Makes no attempt at validation.
23 * @see <a href="http://tools.ietf.org/html/rfc2822">RFC 2822</a>
24 * for the e-mail address specification.
26 public final class Email
implements Serializable
, Comparable
<Email
> {
27 static final long serialVersionUID
= -4807513785819575482L;
31 public Email(String email
) {
33 throw new NullPointerException("email must not be null");
39 * This constructor exists for frameworks (e.g. Google Web Toolkit)
40 * that require it for serialization purposes. It should not be
43 @SuppressWarnings("unused")
48 public String
getEmail() {
53 public int compareTo(Email e
) {
54 return email
.compareTo(e
.email
);
58 public boolean equals(Object o
) {
62 if (o
== null || getClass() != o
.getClass()) {
66 Email email1
= (Email
) o
;
68 if (!email
.equals(email1
.email
)) {
76 public int hashCode() {
77 return email
.hashCode();