Store first, middle, and last name.
[Sone.git] / src / main / java / net / pterodactylus / sone / data / Profile.java
index 22e43c3..eeb04a4 100644 (file)
 package net.pterodactylus.sone.data;
 
 /**
- * A profile stores personal information about a {@link User}.
+ * A profile stores personal information about a {@link User}. All information
+ * is optional and can be {@code null}.
  *
  * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
  */
 public class Profile {
 
-       /** The name of the user this profile belongs to. */
-       private final String username;
+       /** The first name. */
+       private String firstName;
+
+       /** The middle name(s). */
+       private String middleName;
+
+       /** The last name. */
+       private String lastName;
+
+       /**
+        * Creates a new empty profile.
+        */
+       public Profile() {
+               /* do nothing. */
+       }
+
+       /**
+        * Creates a copy of a profile.
+        *
+        * @param profile
+        *            The profile to copy
+        */
+       public Profile(Profile profile) {
+               this.firstName = profile.firstName;
+               this.middleName = profile.middleName;
+               this.lastName = profile.lastName;
+       }
+
+       //
+       // ACCESSORS
+       //
+
+       /**
+        * Returns the first name.
+        *
+        * @return The first name
+        */
+       public String getFirstName() {
+               return firstName;
+       }
+
+       /**
+        * Sets the first name.
+        *
+        * @param firstName
+        *            The first name to set
+        */
+       public void setFirstName(String firstName) {
+               this.firstName = firstName;
+       }
+
+       /**
+        * Returns the middle name(s).
+        *
+        * @return The middle name
+        */
+       public String getMiddleName() {
+               return middleName;
+       }
+
+       /**
+        * Sets the middle name.
+        *
+        * @param middleName
+        *            The middle name to set
+        */
+       public void setMiddleName(String middleName) {
+               this.middleName = middleName;
+       }
 
        /**
-        * Creates a new profile.
+        * Returns the last name.
         *
-        * @param username
-        *            The name of the user this profile belongs to
+        * @return The last name
         */
-       public Profile(String username) {
-               this.username = username;
+       public String getLastName() {
+               return lastName;
        }
 
        /**
-        * Returns the name of the user this profile belongs to.
+        * Sets the last name.
         *
-        * @return The name of the user this profile belongs to
+        * @param lastName
+        *            The last name to set
         */
-       public String getUsername() {
-               return username;
+       public void setLastName(String lastName) {
+               this.lastName = lastName;
        }
 
 }