1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.data.osm;
|
---|
3 |
|
---|
4 | import java.util.Date;
|
---|
5 | import java.util.List;
|
---|
6 |
|
---|
7 | import org.openstreetmap.josm.data.coor.LatLon;
|
---|
8 |
|
---|
9 | /**
|
---|
10 | * Public user information.
|
---|
11 | * @since 2115
|
---|
12 | */
|
---|
13 | public class UserInfo {
|
---|
14 | /** the user id */
|
---|
15 | private int id;
|
---|
16 | /** the display name */
|
---|
17 | private String displayName;
|
---|
18 | /** the date this user was created */
|
---|
19 | private Date accountCreated;
|
---|
20 | /** the home location */
|
---|
21 | private LatLon home;
|
---|
22 | /** the zoom level for the home location */
|
---|
23 | private int homeZoom;
|
---|
24 | /** the profile description */
|
---|
25 | private String description;
|
---|
26 | /** the list of preferred languages */
|
---|
27 | private List<String> languages;
|
---|
28 | /** the number of unread messages */
|
---|
29 | private int unreadMessages;
|
---|
30 |
|
---|
31 | /**
|
---|
32 | * Constructs a new {@code UserInfo}.
|
---|
33 | */
|
---|
34 | public UserInfo() {
|
---|
35 | id = 0;
|
---|
36 | }
|
---|
37 |
|
---|
38 | /**
|
---|
39 | * Returns the user identifier.
|
---|
40 | * @return the user identifier
|
---|
41 | */
|
---|
42 | public int getId() {
|
---|
43 | return id;
|
---|
44 | }
|
---|
45 |
|
---|
46 | /**
|
---|
47 | * Sets the user identifier.
|
---|
48 | * @param id the user identifier
|
---|
49 | */
|
---|
50 | public void setId(int id) {
|
---|
51 | this.id = id;
|
---|
52 | }
|
---|
53 |
|
---|
54 | /**
|
---|
55 | * Returns the display name.
|
---|
56 | * @return the display name
|
---|
57 | */
|
---|
58 | public String getDisplayName() {
|
---|
59 | return displayName;
|
---|
60 | }
|
---|
61 |
|
---|
62 | /**
|
---|
63 | * Sets the display name.
|
---|
64 | * @param displayName display name
|
---|
65 | */
|
---|
66 | public void setDisplayName(String displayName) {
|
---|
67 | this.displayName = displayName;
|
---|
68 | }
|
---|
69 |
|
---|
70 | /**
|
---|
71 | * Returns the date at which the account has been created.
|
---|
72 | * @return the user account creation date
|
---|
73 | */
|
---|
74 | public Date getAccountCreated() {
|
---|
75 | return accountCreated;
|
---|
76 | }
|
---|
77 |
|
---|
78 | /**
|
---|
79 | * Sets the date at which the account has been created.
|
---|
80 | * @param accountCreated user account creation date
|
---|
81 | */
|
---|
82 | public void setAccountCreated(Date accountCreated) {
|
---|
83 | this.accountCreated = accountCreated;
|
---|
84 | }
|
---|
85 |
|
---|
86 | /**
|
---|
87 | * Returns the user home coordinates, if set.
|
---|
88 | * @return the user home lat/lon or null
|
---|
89 | */
|
---|
90 | public LatLon getHome() {
|
---|
91 | return home;
|
---|
92 | }
|
---|
93 |
|
---|
94 | /**
|
---|
95 | * Sets the user home coordinates.
|
---|
96 | * @param home user home lat/lon or null
|
---|
97 | */
|
---|
98 | public void setHome(LatLon home) {
|
---|
99 | this.home = home;
|
---|
100 | }
|
---|
101 |
|
---|
102 | /**
|
---|
103 | * Returns the public account description.
|
---|
104 | * @return the public account description
|
---|
105 | */
|
---|
106 | public String getDescription() {
|
---|
107 | return description;
|
---|
108 | }
|
---|
109 |
|
---|
110 | /**
|
---|
111 | * Sets the public account description.
|
---|
112 | * @param description public account description
|
---|
113 | */
|
---|
114 | public void setDescription(String description) {
|
---|
115 | this.description = description;
|
---|
116 | }
|
---|
117 |
|
---|
118 | /**
|
---|
119 | * Returns the list of preferred languages.
|
---|
120 | * @return the list of preferred languages
|
---|
121 | */
|
---|
122 | public List<String> getLanguages() {
|
---|
123 | return languages;
|
---|
124 | }
|
---|
125 |
|
---|
126 | /**
|
---|
127 | * Sets the list of preferred languages.
|
---|
128 | * @param languages list of preferred languages
|
---|
129 | */
|
---|
130 | public void setLanguages(List<String> languages) {
|
---|
131 | this.languages = languages;
|
---|
132 | }
|
---|
133 |
|
---|
134 | /**
|
---|
135 | * Returns the user home zoom level.
|
---|
136 | * @return the user home zoom level
|
---|
137 | */
|
---|
138 | public int getHomeZoom() {
|
---|
139 | return homeZoom;
|
---|
140 | }
|
---|
141 |
|
---|
142 | /**
|
---|
143 | * Sets the user home zoom level.
|
---|
144 | * @param homeZoom user home zoom level
|
---|
145 | */
|
---|
146 | public void setHomeZoom(int homeZoom) {
|
---|
147 | this.homeZoom = homeZoom;
|
---|
148 | }
|
---|
149 |
|
---|
150 | /**
|
---|
151 | * Replies the number of unread messages
|
---|
152 | * @return the number of unread messages
|
---|
153 | * @since 6349
|
---|
154 | */
|
---|
155 | public final int getUnreadMessages() {
|
---|
156 | return unreadMessages;
|
---|
157 | }
|
---|
158 |
|
---|
159 | /**
|
---|
160 | * Sets the number of unread messages
|
---|
161 | * @param unreadMessages the number of unread messages
|
---|
162 | * @since 6349
|
---|
163 | */
|
---|
164 | public final void setUnreadMessages(int unreadMessages) {
|
---|
165 | this.unreadMessages = unreadMessages;
|
---|
166 | }
|
---|
167 | }
|
---|