Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 6bf5888f28794a0b65540067dee49da95e053e54 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
/*******************************************************************************
 * Copyright (c) 2017 Red Hat Inc. and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Red Hat - Initial Contribution
 *******************************************************************************/
package org.eclipse.linuxtools.internal.mylyn.osio.rest.core.response.data;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;

import org.eclipse.linuxtools.internal.mylyn.osio.rest.core.response.data.Named;

public class UserAttributes implements Named {

	private String userID;
	
	private String identityID;
	
	private Date created_at;
	
	private Date updated_at;
	
	private String fullName;
	
	private String imageURL;
	
	private String username;
	
	private Boolean registrationCompleted;
	
	private String email;
	
	private String company;
	
	private String bio;
	
	private String url;
	
	private String providerType;
	
	// for testing purposes only
	public UserAttributes (String userID, String identityID, Date created_at, Date updated_at,
			String fullName, String imageURL, String username, Boolean registrationCompleted,
			String email, String company, String bio, String url, String providerType) {
		this.userID = userID;
		this.identityID = identityID;
		this.created_at = created_at;
		this.updated_at = updated_at;
		this.fullName = fullName;
		this.imageURL = imageURL;
		this.username = username;
		this.registrationCompleted = registrationCompleted;
		this.email = email;
		this.company = company;
		this.bio = bio;
		this.url = url;
		this.providerType = providerType;
	}
	
	public String getName() {
		return username;
	}
	
	public String getUserID() {
		return userID;
	}

	public void setUserID(String userID) {
		this.userID = userID;
	}

	public String getIdentityID() {
		return identityID;
	}

	public void setIdentityID(String identityID) {
		this.identityID = identityID;
	}

	public Date getCreated_at() {
		return created_at;
	}

	public void setCreated_at(String created_at_string) {
		SimpleDateFormat iso8601Format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'.'SSSSSS'Z'", //$NON-NLS-1$
				Locale.US);
		iso8601Format.setTimeZone(TimeZone.getTimeZone("UTC")); //$NON-NLS-1$
		Date tempDate = null;
		try {
			tempDate = iso8601Format.parse(created_at_string);
		} catch (ParseException e) {
			e.printStackTrace();
		}
		this.created_at = tempDate;
	}

	public Date getUpdated_at() {
		return updated_at;
	}

	public void setUpdated_at(String updated_at_string) {
		SimpleDateFormat iso8601Format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'.'SSSSSS'Z'", //$NON-NLS-1$
				Locale.US);
		iso8601Format.setTimeZone(TimeZone.getTimeZone("UTC")); //$NON-NLS-1$
		Date tempDate = null;
		try {
			tempDate = iso8601Format.parse(updated_at_string);
		} catch (ParseException e) {
			e.printStackTrace();
		}
		this.updated_at = tempDate;
	}

	public String getFullName() {
		return fullName;
	}

	public void setFullName(String fullName) {
		this.fullName = fullName;
	}

	public String getImageURL() {
		return imageURL;
	}

	public void setImageURL(String imageURL) {
		this.imageURL = imageURL;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public Boolean getRegistrationCompleted() {
		return registrationCompleted;
	}

	public void setRegistrationCompleted(Boolean registrationCompleted) {
		this.registrationCompleted = registrationCompleted;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getBio() {
		return bio;
	}

	public void setBio(String bio) {
		this.bio = bio;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getProviderType() {
		return providerType;
	}

	public void setProviderType(String providerType) {
		this.providerType = providerType;
	}

	public String getCompany() {
		return company;
	}

	public void setCompany(String company) {
		this.company = company;
	}

	
}

Back to the top