aboutsummaryrefslogtreecommitdiff
path: root/examples/ListPeople.java
diff options
context:
space:
mode:
authorJisi Liu <jisi.liu@gmail.com>2015-08-21 11:42:27 -0700
committerJisi Liu <jisi.liu@gmail.com>2015-08-21 11:44:49 -0700
commitc3bc155aceda36ecb01cde2367a3b427f2d7ce40 (patch)
tree195d74745dad40a57d49bf718f50c7751336a405 /examples/ListPeople.java
parentb0f661181d10bddc08e380992590a1cdd92be92b (diff)
parenteb65c69e14fb711208ad5111cb9672f00864bb6d (diff)
downloadprotobuf-c3bc155aceda36ecb01cde2367a3b427f2d7ce40.tar.gz
protobuf-c3bc155aceda36ecb01cde2367a3b427f2d7ce40.tar.bz2
protobuf-c3bc155aceda36ecb01cde2367a3b427f2d7ce40.zip
Merge branch 'master' of github.com:google/protobuf
Change-Id: If3fb07754a734bae610d95124528e073515ac525
Diffstat (limited to 'examples/ListPeople.java')
-rw-r--r--examples/ListPeople.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/ListPeople.java b/examples/ListPeople.java
index b2f153af..78924305 100644
--- a/examples/ListPeople.java
+++ b/examples/ListPeople.java
@@ -9,14 +9,14 @@ import java.io.PrintStream;
class ListPeople {
// Iterates though all people in the AddressBook and prints info about them.
static void Print(AddressBook addressBook) {
- for (Person person: addressBook.getPersonList()) {
+ for (Person person: addressBook.getPeopleList()) {
System.out.println("Person ID: " + person.getId());
System.out.println(" Name: " + person.getName());
- if (person.hasEmail()) {
+ if (!person.getEmail().isEmpty()) {
System.out.println(" E-mail address: " + person.getEmail());
}
- for (Person.PhoneNumber phoneNumber : person.getPhoneList()) {
+ for (Person.PhoneNumber phoneNumber : person.getPhonesList()) {
switch (phoneNumber.getType()) {
case MOBILE:
System.out.print(" Mobile phone #: ");