blob: f75484de08a7ead5cf92a51d2ea0789dd4af7ab1 [file] [log] [blame]
liujisi@google.com33165fe2010-11-02 13:14:58 +00001// Protocol Buffers - Google's data interchange format
2// Copyright 2008 Google Inc. All rights reserved.
Feng Xiaoe4288622014-10-01 16:26:23 -07003// https://developers.google.com/protocol-buffers/
liujisi@google.com33165fe2010-11-02 13:14:58 +00004//
5// Redistribution and use in source and binary forms, with or without
6// modification, are permitted provided that the following conditions are
7// met:
8//
9// * Redistributions of source code must retain the above copyright
10// notice, this list of conditions and the following disclaimer.
11// * Redistributions in binary form must reproduce the above
12// copyright notice, this list of conditions and the following disclaimer
13// in the documentation and/or other materials provided with the
14// distribution.
15// * Neither the name of Google Inc. nor the names of its
16// contributors may be used to endorse or promote products derived from
17// this software without specific prior written permission.
18//
19// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
jieluo@google.com4de8f552014-07-18 00:47:59 +000031// Author: pbogle@google.com (Phil Bogle)
liujisi@google.com33165fe2010-11-02 13:14:58 +000032
Feng Xiao6ef984a2014-11-10 17:34:54 -080033syntax = "proto2";
liujisi@google.com33165fe2010-11-02 13:14:58 +000034
jieluo@google.com4de8f552014-07-18 00:47:59 +000035package protobuf_unittest.lite_equals_and_hash;
liujisi@google.com33165fe2010-11-02 13:14:58 +000036
jieluo@google.com4de8f552014-07-18 00:47:59 +000037// This proto definition is used to test that java_generate_equals_and_hash
38// works correctly with the LITE_RUNTIME.
39option java_generate_equals_and_hash = true;
40option optimize_for = LITE_RUNTIME;
liujisi@google.com33165fe2010-11-02 13:14:58 +000041
Jisi Liu3b3c8ab2016-03-30 11:39:59 -070042message TestOneofEquals {
43 oneof oneof_field {
44 string name = 1;
45 int32 value = 2;
46 }
47}
48
jieluo@google.com4de8f552014-07-18 00:47:59 +000049message Foo {
50 optional int32 value = 1;
51 repeated Bar bar = 2;
Feng Xiao6ef984a2014-11-10 17:34:54 -080052
53 extensions 100 to max;
jieluo@google.com4de8f552014-07-18 00:47:59 +000054}
liujisi@google.com33165fe2010-11-02 13:14:58 +000055
jieluo@google.com4de8f552014-07-18 00:47:59 +000056message Bar {
Feng Xiao6ef984a2014-11-10 17:34:54 -080057 extend Foo {
58 optional Bar foo_ext = 100;
59 }
60
jieluo@google.com4de8f552014-07-18 00:47:59 +000061 optional string name = 1;
62}
liujisi@google.com33165fe2010-11-02 13:14:58 +000063
jieluo@google.com4de8f552014-07-18 00:47:59 +000064message BarPrime {
65 optional string name = 1;
66}
liujisi@google.com33165fe2010-11-02 13:14:58 +000067
jieluo@google.com4de8f552014-07-18 00:47:59 +000068message Empty {
69}
Feng Xiao6ef984a2014-11-10 17:34:54 -080070
71extend Foo {
72 optional int32 varint = 101;
73 optional fixed32 fixed32 = 102;
74 optional fixed64 fixed64 = 103;
75 optional group MyGroup = 104 {
76 optional string group_value = 1;
77 }
78}
79
Jisi Liu3b3c8ab2016-03-30 11:39:59 -070080message TestRecursiveOneof {
81 oneof Foo {
82 TestRecursiveOneof r = 1;
83 }
84}