Methods Summary |
---|
public java.lang.String | getBirthDate()Returns the birthDate property value
return (birthDate == null ? "" : birthDate);
|
public java.lang.String | getEmailAddr()Returns the emailAddr property value
return (emailAddr == null ? "" : emailAddr);
|
public java.lang.String[] | getFood()Returns the food property value
return (food == null ? new String[0] : food);
|
public java.lang.String | getGender()Returns the gender property value
return (gender == null ? "" : gender);
|
public java.lang.String | getLuckyNumber()Returns the luckyNumber property value
return (luckyNumber == null ? "" : luckyNumber);
|
public java.lang.String | getUserName()Returns the userName property value
return (userName == null ? "" : userName);
|
public boolean | isBirthDateValid()Validates the birthDate property
boolean isValid = false;
if (birthDate != null &&
StringFormat.isValidDate(birthDate, DATE_FORMAT_PATTERN)) {
isValid = true;
}
return isValid;
|
public boolean | isChineseSelected()Returns true if the food property includes the marker for
Chinese
return isFoodTypeSelected("c");
|
public boolean | isEmailAddrValid()Validates the emailAddr property
boolean isValid = false;
if (emailAddr != null &&
StringFormat.isValidEmailAddr(emailAddr)) {
isValid = true;
}
return isValid;
|
private boolean | isFoodTypeSelected(java.lang.String foodType)Returns true if the food property includes the specified food
type
if (food == null) {
return false;
}
boolean selected = false;
for (int i = 0; i < food.length; i++) {
if (food[i].equals(foodType)) {
selected = true;
break;
}
}
return selected;
|
public boolean | isFoodValid()Validates the food property
boolean isValid = false;
if (food == null ||
StringFormat.isValidString(food, FOOD_LIST, true)) {
isValid = true;
}
return isValid;
|
public boolean | isGenderValid()Validates the gender property
boolean isValid = false;
if (gender != null &&
StringFormat.isValidString(gender, GENDER_LIST, true)) {
isValid = true;
}
return isValid;
|
public boolean | isLuckyNumberValid()Validates the luckyNumber property
boolean isValid = false;
if (luckyNumber != null &&
StringFormat.isValidInteger(luckyNumber, MIN_LUCKY_NUMBER,
MAX_LUCKY_NUMBER)) {
isValid = true;
}
return isValid;
|
public boolean | isPastaSelected()Returns true if the food property includes the marker for
pasta
return isFoodTypeSelected("p");
|
public boolean | isPizzaSelected()Returns true if the food property includes the marker for
pizza
return isFoodTypeSelected("z");
|
public boolean | isUserNameValid()Validates the gender property
boolean isValid = false;
if (userName != null) {
isValid = true;
}
return isValid;
|
public boolean | isValid()Returns true if all property values have valid values
(they are only set if the value is valid).
return isBirthDateValid() && isEmailAddrValid() &&
isFoodValid() && isLuckyNumberValid() &&
isGenderValid() && isUserNameValid();
|
public void | setBirthDate(java.lang.String birthDate)Sets the birthDate property value
this.birthDate = birthDate;
|
public void | setEmailAddr(java.lang.String emailAddr)Sets the emailAddr property value
this.emailAddr = emailAddr;
|
public void | setFood(java.lang.String[] food)Sets the food property value
this.food = food;
|
public void | setGender(java.lang.String gender)Sets the gender property value
this.gender = gender;
|
public void | setLuckyNumber(java.lang.String luckyNumber)Sets the luckyNumber property value
this.luckyNumber = luckyNumber;
|
public void | setUserName(java.lang.String userName)Sets the userName property value
this.userName = userName;
|