001// License: GPL. For details, see LICENSE file. 002package org.openstreetmap.josm.data.osm; 003 004import java.time.Instant; 005import java.util.List; 006 007import org.openstreetmap.josm.data.coor.LatLon; 008 009/** 010 * Public user information. 011 * @since 2115 012 */ 013public class UserInfo { 014 /** the user id */ 015 private int id; 016 /** the display name */ 017 private String displayName; 018 /** the date this user was created */ 019 private Instant accountCreated; 020 /** the home location */ 021 private LatLon home; 022 /** the zoom level for the home location */ 023 private int homeZoom; 024 /** the profile description */ 025 private String description; 026 /** the list of preferred languages */ 027 private List<String> languages; 028 /** the number of unread messages */ 029 private int unreadMessages; 030 031 /** 032 * Constructs a new {@code UserInfo}. 033 */ 034 public UserInfo() { 035 id = 0; 036 } 037 038 /** 039 * Returns the user identifier. 040 * @return the user identifier 041 */ 042 public int getId() { 043 return id; 044 } 045 046 /** 047 * Sets the user identifier. 048 * @param id the user identifier 049 */ 050 public void setId(int id) { 051 this.id = id; 052 } 053 054 /** 055 * Returns the display name. 056 * @return the display name 057 */ 058 public String getDisplayName() { 059 return displayName; 060 } 061 062 /** 063 * Sets the display name. 064 * @param displayName display name 065 */ 066 public void setDisplayName(String displayName) { 067 this.displayName = displayName; 068 } 069 070 /** 071 * Returns the date at which the account has been created. 072 * @return the user account creation date 073 */ 074 public Instant getAccountCreated() { 075 return accountCreated; 076 } 077 078 /** 079 * Sets the date at which the account has been created. 080 * @param accountCreated user account creation date 081 */ 082 public void setAccountCreated(Instant accountCreated) { 083 this.accountCreated = accountCreated; 084 } 085 086 /** 087 * Returns the user home coordinates, if set. 088 * @return the user home lat/lon or null 089 */ 090 public LatLon getHome() { 091 return home; 092 } 093 094 /** 095 * Sets the user home coordinates. 096 * @param home user home lat/lon or null 097 */ 098 public void setHome(LatLon home) { 099 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}