1 package nl.mineleni.openls.databinding.openls;
2
3 import nl.mineleni.openls.XmlNamespaceConstants;
4 import nl.mineleni.openls.databinding.gml.Point;
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 public class GeocodedAddress implements XmlNamespaceConstants {
25
26
27
28 private static final long serialVersionUID = -2711370703109529657L;
29
30
31 private Point point;
32
33
34 private Address address;
35
36
37 private boolean hasPoint;
38
39
40 private boolean hasAddress;
41
42
43
44
45 public GeocodedAddress() {
46 this.hasPoint = false;
47 this.hasAddress = false;
48 }
49
50
51
52
53
54
55
56 public void setPoint(final Point point) {
57 this.hasPoint = true;
58 this.point = point;
59 }
60
61
62
63
64
65
66 public Point getPoint() {
67 return this.point;
68 }
69
70
71
72
73
74
75 public boolean hasPoint() {
76 return this.hasPoint;
77 }
78
79
80
81
82
83
84
85 public void setAddress(final Address address) {
86 this.hasAddress = true;
87 this.address = address;
88 }
89
90
91
92
93
94
95 public Address getAddress() {
96 return this.address;
97 }
98
99
100
101
102
103
104 public boolean hasAddress() {
105 return this.hasAddress;
106 }
107
108
109
110
111
112
113 @Override
114 public String toXML() {
115 String xml = "<" + XmlNamespaceConstants.OPENLS_NAMESPACE_PREFIX
116 + ":GeocodedAddress>";
117 if (this.hasPoint()) {
118 xml += this.point.toXML();
119 }
120 if (this.hasAddress()) {
121 xml += this.address.toXML();
122 }
123 xml += "</" + XmlNamespaceConstants.OPENLS_NAMESPACE_PREFIX
124 + ":GeocodedAddress>";
125 return xml;
126 }
127 }