//package name not required,if not define and not define java_package, will be out put java file to local
package tutorial;
//java_package not required,if not define,will be not create map dir
option java_package = "com.baidu.protobuf";
//java_outer_classname not required,if not define,The class name will be named proto file name
option java_outer_classname = "AddressBooks";
//required: a well-formed message must have exactly one of this field.
//optional: a well-formed message can have zero or one of this field (but not more than one)
//repeated: this field can be repeated any number of times (including zero) in a well-formed
//message. The order of the repeated values will be preserved.
message Person {
required string name = 1;
required int32 id = 2;
optional string email = 3;
enum PhoneType {
MOBILE = 0;
HOME = 1;
WORK = 2;
}
message PhoneNumber {
required string number = 1;
optional PhoneType type = 2 [default = HOME];
}
repeated PhoneNumber phone = 4;
}
message AddressBook {
repeated Person person = 1;
}
我的配置文件如此