|
From: <ps...@us...> - 2017-05-08 19:14:13
|
Revision: 278
http://sourceforge.net/p/vlibrary/code/278
Author: psteitz
Date: 2017-05-08 19:14:11 +0000 (Mon, 08 May 2017)
Log Message:
-----------
Formatting, plus do not display pwd in toString.
Modified Paths:
--------------
branches/VLIBRARY_2_X/src/main/java/org/sourceforge/vlibrary/user/domain/Reader.java
Modified: branches/VLIBRARY_2_X/src/main/java/org/sourceforge/vlibrary/user/domain/Reader.java
===================================================================
--- branches/VLIBRARY_2_X/src/main/java/org/sourceforge/vlibrary/user/domain/Reader.java 2017-05-08 19:07:55 UTC (rev 277)
+++ branches/VLIBRARY_2_X/src/main/java/org/sourceforge/vlibrary/user/domain/Reader.java 2017-05-08 19:14:11 UTC (rev 278)
@@ -22,10 +22,10 @@
private String uid="";
private String pwd="";
private boolean administrator=false;
-
+
public Reader() {
}
-
+
public Reader(
String lastName,
String firstName,
@@ -50,7 +50,7 @@
this.pwd = pwd;
this.administrator = administrator;
}
-
+
public String toString() {
return "<Reader " +
"id=\"" + id +
@@ -63,119 +63,118 @@
"\" screenName=\"" + screenName +
"\" imService=\"" + imService +
"\" uid=\"" + uid +
- "\" pwd=\"" + pwd +
"\" administrator=\"" + administrator +
"\" />";
}
-
+
public Reader(String email) {
this.email=email;
}
-
+
public String getFirstName() {
return firstName;
}
-
+
public long getId() {
return id;
}
-
+
public String getLastName() {
return lastName;
}
-
+
public void setFirstName(String firstName) {
this.firstName = firstName;
}
-
+
public void setId(long id) {
this.id = id;
}
-
+
public void setId(Long id) {
this.id = id.longValue();
}
-
+
public void setId(Integer id) {
this.id = id.longValue();
}
-
+
public void setLastName(String lastName) {
this.lastName = lastName;
}
-
+
public String getDeskPhone() {
return deskPhone;
}
-
+
public void setDeskPhone(String deskPhone) {
this.deskPhone = deskPhone;
}
-
+
public String getEmail() {
return email;
}
-
+
public void setEmail(String email) {
this.email = email;
}
-
+
public String getImService() {
return imService;
}
-
+
public void setImService(String imService) {
this.imService = imService;
}
-
+
public String getMobilePhone() {
return mobilePhone;
}
-
+
public void setMobilePhone(String mobilePhone) {
this.mobilePhone = mobilePhone;
}
-
+
public String getPager() {
return pager;
}
-
+
public void setPager(String pager) {
this.pager = pager;
}
-
+
public String getPwd() {
return pwd;
}
-
+
public void setPwd(String pwd) {
this.pwd = pwd;
}
-
+
public String getScreenName() {
return screenName;
}
-
+
public void setScreenName(String screenName) {
this.screenName = screenName;
}
-
+
public String getUid() {
return uid;
}
-
+
public void setUid(String uid) {
this.uid = uid;
}
-
+
public boolean isAdministrator() {
return administrator;
}
-
+
public void setAdministrator(boolean administrator) {
this.administrator = administrator;
}
-
+
/**
* Normalizes phone numbers to nnn-nnn-nnnn format by stripping
* all non-numeric chars and replacing with "-", other than initial
@@ -187,15 +186,15 @@
if ((phoneString == null) || (phoneString.length() == 0)) {
return "";
}
-
+
StringBuffer out = new StringBuffer();
String thisChar = "";
String lagChar="x";
String inString = phoneString.trim();
-
+
for (int i = 0; i<inString.length(); i++) {
thisChar = inString.substring(i,i+1);
-
+
if (StringUtils.isNumeric(thisChar)) {
out.append(thisChar);
} else {
@@ -206,7 +205,7 @@
}
return out.toString();
}
-
+
/**
* Returns true iff obj is a reader and admin status, id, deskPhone, mobilePhone,
* email, firstName, lastName, imService, pager, screenName and uid fields match
@@ -219,13 +218,13 @@
if (this == obj) {
return true;
}
-
+
if((obj == null) || !(obj instanceof Reader)) {
return false;
}
-
+
Reader reader = (Reader) obj;
-
+
if (this.deskPhone == null && reader.getDeskPhone() != null) {
return false;
}
@@ -241,23 +240,23 @@
if (this.mobilePhone == null && reader.getMobilePhone() != null) {
return false;
}
- if ((this.pager != null && this.pager.equals("")) &&
+ if ((this.pager != null && this.pager.equals("")) &&
(reader.getPager()!= null &&!reader.getPager().equals(""))) {
return false;
}
- if ((this.screenName!= null && this.screenName.equals("")) &&
+ if ((this.screenName!= null && this.screenName.equals("")) &&
(reader.getScreenName()!= null && !reader.getScreenName().equals(""))) {
return false;
}
- if ((this.uid!= null && this.uid.equals("")) &&
+ if ((this.uid!= null && this.uid.equals("")) &&
(reader.getUid() != null && !reader.getUid().equals(""))) {
return false;
}
- if ((this.imService != null && this.imService.equals("")) &&
+ if ((this.imService != null && this.imService.equals("")) &&
(reader.getImService() != null && !reader.getImService().equals(""))) {
return false;
}
-
+
return
(this.id == reader.getId()) &&
(this.deskPhone == null ||
@@ -267,20 +266,20 @@
(this.firstName == null ||
this.firstName.equals(reader.getFirstName())) &&
(this.lastName == null ||
- this.lastName.equals(reader.getLastName())) &&
+ this.lastName.equals(reader.getLastName())) &&
(this.imService == null ||
- this.imService.equals(reader.getImService())) &&
+ this.imService.equals(reader.getImService())) &&
(this.mobilePhone == null ||
- this.mobilePhone.equals(reader.getMobilePhone())) &&
+ this.mobilePhone.equals(reader.getMobilePhone())) &&
(this.pager == null ||
- this.pager.equals(reader.getPager())) &&
+ this.pager.equals(reader.getPager())) &&
(this.uid == null ||
- this.uid.equals(reader.getUid())) &&
+ this.uid.equals(reader.getUid())) &&
(this.screenName == null ||
- this.screenName.equals(reader.getScreenName())) &&
+ this.screenName.equals(reader.getScreenName())) &&
(this.administrator == reader.isAdministrator());
}
-
+
public int hashCode() {
int hash = (int) this.id * 7;
String cat = this.deskPhone + "|" + this.email +
@@ -289,6 +288,6 @@
this.screenName + "|" + this.administrator;
return 31 * hash + cat.hashCode();
}
-
-
+
+
}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|