1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.kpme.tklm.time.user.pref;
17
18 import org.apache.commons.lang.StringUtils;
19 import org.kuali.kpme.core.util.TKUtils;
20 import org.kuali.kpme.tklm.api.time.user.pref.UserPreferencesContract;
21 import org.kuali.kpme.tklm.common.TkConstants;
22 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
23
24 public class UserPreferences extends PersistableBusinessObjectBase implements UserPreferencesContract {
25 public static final String CACHE_NAME = TkConstants.CacheNamespace.NAMESPACE_PREFIX + "UserPreferences";
26
27 private static final long serialVersionUID = 1L;
28 private String principalId;
29 private String timezone;
30
31 public UserPreferences(){}
32
33 public UserPreferences(String principalId, String timeZone){
34 this.principalId = principalId;
35 this.timezone = timeZone;
36 }
37
38 public void setTimezone(String timezone) {
39 this.timezone = timezone;
40 }
41
42 public String getTimezone() {
43 if (StringUtils.isEmpty(timezone))
44 return TKUtils.getSystemTimeZone();
45
46 return timezone;
47 }
48
49 public String getPrincipalId() {
50 return principalId;
51 }
52
53 public void setPrincipalId(String principalId) {
54 this.principalId = principalId;
55 }
56
57 }