Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Unified Diff: third_party/protobuf/examples/ListPeople.java

Issue 1322483002: Revert https://codereview.chromium.org/1291903002 (protobuf roll). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/protobuf/examples/AddPerson.java ('k') | third_party/protobuf/examples/README.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/protobuf/examples/ListPeople.java
diff --git a/third_party/protobuf/examples/ListPeople.java b/third_party/protobuf/examples/ListPeople.java
deleted file mode 100644
index 789243050888e95b47a7011e7311cabeba03ce41..0000000000000000000000000000000000000000
--- a/third_party/protobuf/examples/ListPeople.java
+++ /dev/null
@@ -1,50 +0,0 @@
-// See README.txt for information and build instructions.
-
-import com.example.tutorial.AddressBookProtos.AddressBook;
-import com.example.tutorial.AddressBookProtos.Person;
-import java.io.FileInputStream;
-import java.io.IOException;
-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.getPeopleList()) {
- System.out.println("Person ID: " + person.getId());
- System.out.println(" Name: " + person.getName());
- if (!person.getEmail().isEmpty()) {
- System.out.println(" E-mail address: " + person.getEmail());
- }
-
- for (Person.PhoneNumber phoneNumber : person.getPhonesList()) {
- switch (phoneNumber.getType()) {
- case MOBILE:
- System.out.print(" Mobile phone #: ");
- break;
- case HOME:
- System.out.print(" Home phone #: ");
- break;
- case WORK:
- System.out.print(" Work phone #: ");
- break;
- }
- System.out.println(phoneNumber.getNumber());
- }
- }
- }
-
- // Main function: Reads the entire address book from a file and prints all
- // the information inside.
- public static void main(String[] args) throws Exception {
- if (args.length != 1) {
- System.err.println("Usage: ListPeople ADDRESS_BOOK_FILE");
- System.exit(-1);
- }
-
- // Read the existing address book.
- AddressBook addressBook =
- AddressBook.parseFrom(new FileInputStream(args[0]));
-
- Print(addressBook);
- }
-}
« no previous file with comments | « third_party/protobuf/examples/AddPerson.java ('k') | third_party/protobuf/examples/README.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698