Index: third_party/protobuf/java/src/main/java/com/google/protobuf/ExtensionLite.java |
diff --git a/third_party/protobuf/src/google/protobuf/unittest_optimize_for.proto b/third_party/protobuf/java/src/main/java/com/google/protobuf/ExtensionLite.java |
similarity index 62% |
copy from third_party/protobuf/src/google/protobuf/unittest_optimize_for.proto |
copy to third_party/protobuf/java/src/main/java/com/google/protobuf/ExtensionLite.java |
index feecbef8d4a90961b35be988402e49e74fed313c..f8f5bd2c4fd0c38436a99d2d0b3bb1f7bf5d3c87 100644 |
--- a/third_party/protobuf/src/google/protobuf/unittest_optimize_for.proto |
+++ b/third_party/protobuf/java/src/main/java/com/google/protobuf/ExtensionLite.java |
@@ -1,6 +1,6 @@ |
// Protocol Buffers - Google's data interchange format |
// Copyright 2008 Google Inc. All rights reserved. |
-// http://code.google.com/p/protobuf/ |
+// https://developers.google.com/protocol-buffers/ |
// |
// Redistribution and use in source and binary forms, with or without |
// modification, are permitted provided that the following conditions are |
@@ -28,34 +28,36 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-// Author: kenton@google.com (Kenton Varda) |
-// Based on original Protocol Buffers design by |
-// Sanjay Ghemawat, Jeff Dean, and others. |
-// |
-// A proto file which uses optimize_for = CODE_SIZE. |
- |
-import "google/protobuf/unittest.proto"; |
- |
-package protobuf_unittest; |
- |
-option optimize_for = CODE_SIZE; |
- |
-message TestOptimizedForSize { |
- optional int32 i = 1; |
- optional ForeignMessage msg = 19; |
- |
- extensions 1000 to max; |
- |
- extend TestOptimizedForSize { |
- optional int32 test_extension = 1234; |
- optional TestRequiredOptimizedForSize test_extension2 = 1235; |
+package com.google.protobuf; |
+ |
+/** |
+ * Lite interface that generated extensions implement. |
+ * <p> |
+ * Methods are for use by generated code only. You can hold a reference to |
+ * extensions using this type name. |
+ */ |
+public abstract class ExtensionLite<ContainingType extends MessageLite, Type> { |
+ |
+ /** Returns the field number of the extension. */ |
+ public abstract int getNumber(); |
+ |
+ /** Returns the type of the field. */ |
+ public abstract WireFormat.FieldType getLiteType(); |
+ |
+ /** Returns whether it is a repeated field. */ |
+ public abstract boolean isRepeated(); |
+ |
+ /** Returns the default value of the extension field. */ |
+ public abstract Type getDefaultValue(); |
+ |
+ /** |
+ * Returns the default instance of the extension field, if it's a message |
+ * extension. |
+ */ |
+ public abstract MessageLite getMessageDefaultInstance(); |
+ |
+ /** Returns whether or not this extension is a Lite Extension. */ |
+ boolean isLite() { |
+ return true; |
} |
} |
- |
-message TestRequiredOptimizedForSize { |
- required int32 x = 1; |
-} |
- |
-message TestOptionalOptimizedForSize { |
- optional TestRequiredOptimizedForSize o = 1; |
-} |