]> git.mxchange.org Git - juser-login-core.git/commitdiff
added user-specific locale. this allows the user to have hin/her language back once...
authorRoland Häder <roland@mxchange.org>
Mon, 23 May 2016 07:21:17 +0000 (09:21 +0200)
committerRoland Häder <roland@mxchange.org>
Mon, 23 May 2016 07:21:17 +0000 (09:21 +0200)
src/org/mxchange/jusercore/model/user/LoginUser.java
src/org/mxchange/jusercore/model/user/User.java

index 523567d2cb334a11ffe4e3856fffe0dfa39b0971..a8a835dbf7e90795607fd2802a1a44a1549ce959 100644 (file)
@@ -17,6 +17,7 @@
 package org.mxchange.jusercore.model.user;
 
 import java.util.Calendar;
+import java.util.Locale;
 import java.util.Objects;
 import javax.persistence.Basic;
 import javax.persistence.CascadeType;
@@ -129,6 +130,12 @@ public class LoginUser implements User {
        @Column (name = "user_last_locked_reason")
        private String userLastLockedReason;
 
+       /**
+        * User locale
+        */
+       @Column(name = "user_locale")
+       private Locale userLocale;
+
        /**
         * User name
         */
@@ -176,6 +183,7 @@ public class LoginUser implements User {
                this.setUserLastLocked(user.getUserLastLocked());
                this.setUserUpdated(user.getUserUpdated());
                this.setUserProfileMode(user.getUserProfileMode());
+               this.setUserLocale(user.getUserLocale());
        }
 
        @Override
@@ -276,6 +284,16 @@ public class LoginUser implements User {
                this.userLastLockedReason = userLastLockedReason;
        }
 
+       @Override
+       public Locale getUserLocale () {
+               return this.userLocale;
+       }
+
+       @Override
+       public void setUserLocale (final Locale userLocale) {
+               this.userLocale = userLocale;
+       }
+
        @Override
        public String getUserName () {
                return this.userName;
index 1c8692ac4e59d7b00cd23a17aa5ff47d21ed6fe6..8bdd4c7bfba5a094eb3a12a2f21d2a6d89378073 100644 (file)
@@ -18,6 +18,7 @@ package org.mxchange.jusercore.model.user;
 
 import java.io.Serializable;
 import java.util.Calendar;
+import java.util.Locale;
 import org.mxchange.jcontacts.contact.Contact;
 import org.mxchange.jusercore.model.user.profilemodes.ProfileMode;
 import org.mxchange.jusercore.model.user.status.UserAccountStatus;
@@ -190,9 +191,24 @@ public interface User extends Serializable {
         */
        void setUserUpdated (final Calendar userUpdated);
 
+       /**
+        * Getter for user's locale
+        * <p>
+        * @return User's locale
+        */
+       Locale getUserLocale ();
+
+       /**
+        * Setteror user's locale
+        * <p>
+        * @param userLocale User's locale
+        */
+       void setUserLocale (final Locale userLocale);
+
        @Override
        boolean equals (final Object object);
 
        @Override
        int hashCode ();
+
 }