01: /**
02: * $Id: SAPUserConfig.java,v 1.2 2005/08/12 07:38:22 nk137934 Exp $
03: * Copyright 2005 Sun Microsystems, Inc. All
04: * rights reserved. Use of this product is subject
05: * to license terms. Federal Acquisitions:
06: * Commercial Software -- Government Users
07: * Subject to Standard License Terms and
08: * Conditions.
09: *
10: * Sun, Sun Microsystems, the Sun logo, and Sun ONE
11: * are trademarks or registered trademarks of Sun Microsystems,
12: * Inc. in the United States and other countries.
13: */package com.sun.portal.sapportlet.config;
14:
15: /**
16: * The SAPUserConfig encapsulates an SAP user's credentials namely
17: * the SAP username and password.
18: * @author nk137934
19: */
20: public class SAPUserConfig {
21:
22: /** The user name **/
23: private String userName;
24:
25: /** The password **/
26: private String userPassword;
27:
28: /**
29: * Creates a new instance of SAPUserConfig
30: * @param userName user name
31: * @param userPassword password
32: */
33: public SAPUserConfig(String userName, String userPassword) {
34: setUserName(userName);
35: setUserPassword(userPassword);
36: }
37:
38: /**
39: * Returns the user name
40: * @return username
41: */
42: public String getUserName() {
43: return userName;
44: }
45:
46: /**
47: * Set the user name
48: * @param userName usename
49: */
50: public void setUserName(String userName) {
51: this .userName = userName;
52: }
53:
54: /**
55: * Returns the user name
56: * @return username
57: */
58: public String getUserPassword() {
59: return userPassword;
60: }
61:
62: /**
63: * Sets the password
64: * @param userPassword password
65: */
66: public void setUserPassword(String userPassword) {
67: this .userPassword = userPassword;
68: }
69:
70: /*
71: * Compares this config object with another config object.
72: * The objects are considered equal if both the username
73: * and password are identical
74: */
75: /**
76: * Objects with the same username and password are considered equal
77: * @param obj object
78: * @return true is the objects are equal, else false
79: */
80: public boolean equals(Object obj) {
81: if ((obj == null) || !(obj instanceof SAPUserConfig)) {
82: return false;
83: }
84: SAPUserConfig config = (SAPUserConfig) obj;
85:
86: return (config.getUserName().equals(userName) && config
87: .getUserPassword().equals(userPassword));
88: }
89:
90: }
|