public String getFavoriteProgrammingLanguage() {
return favoriteProgrammingLanguage;
}
public void setFavoriteProgrammingLanguage(String favoriteProgrammingLanguage) {
this.favoriteProgrammingLanguage = favoriteProgrammingLanguage;
}
public Name getName() {
return name;
}
public void setName(Name name) {
this.name = name;
}
@Override
public String toString() {
StringBuffer sb = new StringBuffer();
sb.append("Name: [");
sb.append(name.toString());
sb.append("], ");
sb.append("Born On: [");
sb.append(bornOn);
sb.append("], ");
sb.append("Favorite Programming Language: [");
sb.append(favoriteProgrammingLanguage);
sb.append("]");
return sb.toString();
}
}
Listing 6-40.Name Bean
public class Name {
private String first;
private String last;
public String getFirst() {
return first;
}
public void setFirst(String first) {
this.first = first;
}
public String getLast() {
return last;
}
public void setLast(String last) {
this.last = last;
}
@Override
public String toString() {
156 CHAPTER 6 ■THE CONTROLLER MENAGERIE