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