# HG changeset patch # User Ingo Weinzierl # Date 1297323411 0 # Node ID 901f384ddad99da974f05dff49b7a25e8781e379 # Parent 33271242e3039109a773d43d987ebab55473d710 Added an interface and its default implementation for a User. artifacts/trunk@1307 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 33271242e303 -r 901f384ddad9 ChangeLog --- 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 + + * 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 * artifact-database/src/main/java/de/intevation/artifactdatabase/state/State.java: diff -r 33271242e303 -r 901f384ddad9 artifacts-common/src/main/java/de/intevation/artifacts/common/model/DefaultUser.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 Ingo Weinzierl + */ +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 : diff -r 33271242e303 -r 901f384ddad9 artifacts-common/src/main/java/de/intevation/artifacts/common/model/User.java --- /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 Ingo Weinzierl + */ +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 :