changeset 111:901f384ddad9

Added an interface and its default implementation for a User. artifacts/trunk@1307 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 10 Feb 2011 07:36:51 +0000
parents 33271242e303
children 2f35e8a84004
files ChangeLog artifacts-common/src/main/java/de/intevation/artifacts/common/model/DefaultUser.java artifacts-common/src/main/java/de/intevation/artifacts/common/model/User.java
diffstat 3 files changed, 124 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Feb 07 17:35:16 2011 +0000
+++ b/ChangeLog	Thu Feb 10 07:36:51 2011 +0000
@@ -1,3 +1,9 @@
+2011-02-10  Ingo Weinzierl <ingo@intevation.de>
+
+	* artifacts-common/src/main/java/de/intevation/artifacts/common/model/User.java,
+	  artifacts-common/src/main/java/de/intevation/artifacts/common/model/DefaultUser.java:
+	  The interface description and a default implementation of a user.
+
 2011-02-07  Ingo Weinzierl <ingo@intevation.de>
 
 	* artifact-database/src/main/java/de/intevation/artifactdatabase/state/State.java:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/artifacts-common/src/main/java/de/intevation/artifacts/common/model/DefaultUser.java	Thu Feb 10 07:36:51 2011 +0000
@@ -0,0 +1,75 @@
+package de.intevation.artifacts.common.model;
+
+/**
+ * The default implementation of the {@link User} interface.
+ *
+ * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
+ */
+public class DefaultUser implements User {
+
+    /** The user's firstname. */
+    protected String firstName;
+
+    /** The user's lastname. */
+    protected String lastName;
+
+
+    /**
+     * Creates an empty user without name.
+     */
+    public DefaultUser() {
+    }
+
+
+    /**
+     * Creates a user with first and lastname.
+     *
+     * @param firstName The user's firstname.
+     * @param lastName The user's lastname.
+     */
+    public DefaultUser(String firstName, String lastName) {
+        this.firstName = firstName;
+        this.lastName  = lastName;
+    }
+
+
+    /**
+     * This method returns the firstname of the user.
+     *
+     * @return the firstname.
+     */
+    public String getFirstName() {
+        return firstName;
+    }
+
+
+    /**
+     * Sets the user's firstname.
+     *
+     * @param firstName The user's firstname.
+     */
+    public void setFirstName(String firstName) {
+        this.firstName = firstName;
+    }
+
+
+    /**
+     * This method returns the lastname of the user.
+     *
+     * @return the lastname.
+     */
+    public String getLastName() {
+        return lastName;
+    }
+
+
+    /**
+     * Sets the user's lastname.
+     *
+     * @param lastName The user's lastname.
+     */
+    public void setLastName(String lastName) {
+        this.lastName = lastName;
+    }
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/artifacts-common/src/main/java/de/intevation/artifacts/common/model/User.java	Thu Feb 10 07:36:51 2011 +0000
@@ -0,0 +1,43 @@
+package de.intevation.artifacts.common.model;
+
+import java.io.Serializable;
+
+/**
+ * An interface that describes a user of the system.
+ *
+ * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
+ */
+public interface User extends Serializable {
+
+    /**
+     * This method returns the firstname of the user.
+     *
+     * @return the firstname.
+     */
+    public String getFirstName();
+
+
+    /**
+     * Sets the user's firstname.
+     *
+     * @param firstName The user's firstname.
+     */
+    public void setFirstName(String firstName);
+
+
+    /**
+     * This method returns the lastname of the user.
+     *
+     * @return the lastname.
+     */
+    public String getLastName();
+
+
+    /**
+     * Sets the user's lastname.
+     *
+     * @param lastName The user's lastname.
+     */
+    public void setLastName(String lastName);
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org