1 package rydeen.utils;
2
3 import java.io.Serializable;
4
5
6
7
8
9
10 public class Author implements Serializable{
11 private static final long serialVersionUID = -1102911800329646249L;
12
13 private String name;
14 private String email;
15
16
17
18
19
20
21
22
23
24 public Author(String name, String email){
25 if(name == null){
26 throw new NullPointerException();
27 }
28 this.name = name;
29 this.email = email;
30 }
31
32
33
34
35
36
37
38
39 public Author(String name){
40 this(name, null);
41 }
42
43
44
45
46 public String getName(){
47 return name;
48 }
49
50
51
52
53
54 public String getEmail(){
55 return email;
56 }
57
58
59
60
61 @Override
62 public String toString(){
63 StringBuilder sb = new StringBuilder();
64 sb.append(getName());
65 if(getEmail() != null){
66 sb.append(" <").append(getEmail()).append(">");
67 }
68 return new String(sb);
69 }
70 }