|
|
@ -59,6 +59,7 @@ import java.io.OutputStream; |
|
|
|
* |
|
|
|
* |
|
|
|
* @author kenton@google.com Kenton Varda |
|
|
|
* @author kenton@google.com Kenton Varda |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
@CheckReturnValue |
|
|
|
public interface MessageLite extends MessageLiteOrBuilder { |
|
|
|
public interface MessageLite extends MessageLiteOrBuilder { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -138,6 +139,7 @@ public interface MessageLite extends MessageLiteOrBuilder { |
|
|
|
/** Abstract interface implemented by Protocol Message builders. */ |
|
|
|
/** Abstract interface implemented by Protocol Message builders. */ |
|
|
|
interface Builder extends MessageLiteOrBuilder, Cloneable { |
|
|
|
interface Builder extends MessageLiteOrBuilder, Cloneable { |
|
|
|
/** Resets all fields to their default values. */ |
|
|
|
/** Resets all fields to their default values. */ |
|
|
|
|
|
|
|
@CanIgnoreReturnValue |
|
|
|
Builder clear(); |
|
|
|
Builder clear(); |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -181,11 +183,12 @@ public interface MessageLite extends MessageLiteOrBuilder { |
|
|
|
* <p>Note: The caller should call {@link CodedInputStream#checkLastTagWas(int)} after calling |
|
|
|
* <p>Note: The caller should call {@link CodedInputStream#checkLastTagWas(int)} after calling |
|
|
|
* this to verify that the last tag seen was the appropriate end-group tag, or zero for EOF. |
|
|
|
* this to verify that the last tag seen was the appropriate end-group tag, or zero for EOF. |
|
|
|
* |
|
|
|
* |
|
|
|
* @throws InvalidProtocolBufferException the bytes read are not syntactically correct |
|
|
|
* @throws InvalidProtocolBufferException the bytes read are not syntactically correct according |
|
|
|
* according to the protobuf wire format specification. The data is corrupt, incomplete, |
|
|
|
* to the protobuf wire format specification. The data is corrupt, incomplete, or was never |
|
|
|
* or was never a protobuf in the first place. |
|
|
|
* a protobuf in the first place. |
|
|
|
* @throws IOException an I/O error reading from the stream |
|
|
|
* @throws IOException an I/O error reading from the stream |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
@CanIgnoreReturnValue |
|
|
|
Builder mergeFrom(CodedInputStream input) throws IOException; |
|
|
|
Builder mergeFrom(CodedInputStream input) throws IOException; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -193,11 +196,12 @@ public interface MessageLite extends MessageLiteOrBuilder { |
|
|
|
* that you want to be able to parse must be registered in {@code extensionRegistry}. Extensions |
|
|
|
* that you want to be able to parse must be registered in {@code extensionRegistry}. Extensions |
|
|
|
* not in the registry will be treated as unknown fields. |
|
|
|
* not in the registry will be treated as unknown fields. |
|
|
|
* |
|
|
|
* |
|
|
|
* @throws InvalidProtocolBufferException the bytes read are not syntactically correct |
|
|
|
* @throws InvalidProtocolBufferException the bytes read are not syntactically correct according |
|
|
|
* according to the protobuf wire format specification. The data is corrupt, incomplete, |
|
|
|
* to the protobuf wire format specification. The data is corrupt, incomplete, or was never |
|
|
|
* or was never a protobuf in the first place. |
|
|
|
* a protobuf in the first place. |
|
|
|
* @throws IOException an I/O error reading from the stream |
|
|
|
* @throws IOException an I/O error reading from the stream |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
@CanIgnoreReturnValue |
|
|
|
Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) |
|
|
|
Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) |
|
|
|
throws IOException; |
|
|
|
throws IOException; |
|
|
|
|
|
|
|
|
|
|
@ -209,10 +213,11 @@ public interface MessageLite extends MessageLiteOrBuilder { |
|
|
|
* is just a small wrapper around {@link #mergeFrom(CodedInputStream)}. |
|
|
|
* is just a small wrapper around {@link #mergeFrom(CodedInputStream)}. |
|
|
|
* |
|
|
|
* |
|
|
|
* @throws InvalidProtocolBufferException the bytes in data are not syntactically correct |
|
|
|
* @throws InvalidProtocolBufferException the bytes in data are not syntactically correct |
|
|
|
* according to the protobuf wire format specification. The data is corrupt, incomplete, |
|
|
|
* according to the protobuf wire format specification. The data is corrupt, incomplete, or |
|
|
|
* or was never a protobuf in the first place. |
|
|
|
* was never a protobuf in the first place. |
|
|
|
* @return this |
|
|
|
* @return this |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
@CanIgnoreReturnValue |
|
|
|
Builder mergeFrom(ByteString data) throws InvalidProtocolBufferException; |
|
|
|
Builder mergeFrom(ByteString data) throws InvalidProtocolBufferException; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -220,10 +225,11 @@ public interface MessageLite extends MessageLiteOrBuilder { |
|
|
|
* is just a small wrapper around {@link #mergeFrom(CodedInputStream,ExtensionRegistryLite)}. |
|
|
|
* is just a small wrapper around {@link #mergeFrom(CodedInputStream,ExtensionRegistryLite)}. |
|
|
|
* |
|
|
|
* |
|
|
|
* @throws InvalidProtocolBufferException the bytes in data are not syntactically correct |
|
|
|
* @throws InvalidProtocolBufferException the bytes in data are not syntactically correct |
|
|
|
* according to the protobuf wire format specification. The data is corrupt, incomplete, |
|
|
|
* according to the protobuf wire format specification. The data is corrupt, incomplete, or |
|
|
|
* or was never a protobuf in the first place. |
|
|
|
* was never a protobuf in the first place. |
|
|
|
* @return this |
|
|
|
* @return this |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
@CanIgnoreReturnValue |
|
|
|
Builder mergeFrom(ByteString data, ExtensionRegistryLite extensionRegistry) |
|
|
|
Builder mergeFrom(ByteString data, ExtensionRegistryLite extensionRegistry) |
|
|
|
throws InvalidProtocolBufferException; |
|
|
|
throws InvalidProtocolBufferException; |
|
|
|
|
|
|
|
|
|
|
@ -232,10 +238,11 @@ public interface MessageLite extends MessageLiteOrBuilder { |
|
|
|
* is just a small wrapper around {@link #mergeFrom(CodedInputStream)}. |
|
|
|
* is just a small wrapper around {@link #mergeFrom(CodedInputStream)}. |
|
|
|
* |
|
|
|
* |
|
|
|
* @throws InvalidProtocolBufferException the bytes in data are not syntactically correct |
|
|
|
* @throws InvalidProtocolBufferException the bytes in data are not syntactically correct |
|
|
|
* according to the protobuf wire format specification. The data is corrupt, incomplete, |
|
|
|
* according to the protobuf wire format specification. The data is corrupt, incomplete, or |
|
|
|
* or was never a protobuf in the first place. |
|
|
|
* was never a protobuf in the first place. |
|
|
|
* @return this |
|
|
|
* @return this |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
@CanIgnoreReturnValue |
|
|
|
Builder mergeFrom(byte[] data) throws InvalidProtocolBufferException; |
|
|
|
Builder mergeFrom(byte[] data) throws InvalidProtocolBufferException; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -243,10 +250,11 @@ public interface MessageLite extends MessageLiteOrBuilder { |
|
|
|
* is just a small wrapper around {@link #mergeFrom(CodedInputStream)}. |
|
|
|
* is just a small wrapper around {@link #mergeFrom(CodedInputStream)}. |
|
|
|
* |
|
|
|
* |
|
|
|
* @throws InvalidProtocolBufferException the bytes in data are not syntactically correct |
|
|
|
* @throws InvalidProtocolBufferException the bytes in data are not syntactically correct |
|
|
|
* according to the protobuf wire format specification. The data is corrupt, incomplete, |
|
|
|
* according to the protobuf wire format specification. The data is corrupt, incomplete, or |
|
|
|
* or was never a protobuf in the first place. |
|
|
|
* was never a protobuf in the first place. |
|
|
|
* @return this |
|
|
|
* @return this |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
@CanIgnoreReturnValue |
|
|
|
Builder mergeFrom(byte[] data, int off, int len) throws InvalidProtocolBufferException; |
|
|
|
Builder mergeFrom(byte[] data, int off, int len) throws InvalidProtocolBufferException; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -254,10 +262,11 @@ public interface MessageLite extends MessageLiteOrBuilder { |
|
|
|
* is just a small wrapper around {@link #mergeFrom(CodedInputStream,ExtensionRegistryLite)}. |
|
|
|
* is just a small wrapper around {@link #mergeFrom(CodedInputStream,ExtensionRegistryLite)}. |
|
|
|
* |
|
|
|
* |
|
|
|
* @throws InvalidProtocolBufferException the bytes in data are not syntactically correct |
|
|
|
* @throws InvalidProtocolBufferException the bytes in data are not syntactically correct |
|
|
|
* according to the protobuf wire format specification. The data is corrupt, incomplete, |
|
|
|
* according to the protobuf wire format specification. The data is corrupt, incomplete, or |
|
|
|
* or was never a protobuf in the first place. |
|
|
|
* was never a protobuf in the first place. |
|
|
|
* @return this |
|
|
|
* @return this |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
@CanIgnoreReturnValue |
|
|
|
Builder mergeFrom(byte[] data, ExtensionRegistryLite extensionRegistry) |
|
|
|
Builder mergeFrom(byte[] data, ExtensionRegistryLite extensionRegistry) |
|
|
|
throws InvalidProtocolBufferException; |
|
|
|
throws InvalidProtocolBufferException; |
|
|
|
|
|
|
|
|
|
|
@ -266,10 +275,11 @@ public interface MessageLite extends MessageLiteOrBuilder { |
|
|
|
* is just a small wrapper around {@link #mergeFrom(CodedInputStream,ExtensionRegistryLite)}. |
|
|
|
* is just a small wrapper around {@link #mergeFrom(CodedInputStream,ExtensionRegistryLite)}. |
|
|
|
* |
|
|
|
* |
|
|
|
* @throws InvalidProtocolBufferException the bytes in data are not syntactically correct |
|
|
|
* @throws InvalidProtocolBufferException the bytes in data are not syntactically correct |
|
|
|
* according to the protobuf wire format specification. The data is corrupt, incomplete, |
|
|
|
* according to the protobuf wire format specification. The data is corrupt, incomplete, or |
|
|
|
* or was never a protobuf in the first place. |
|
|
|
* was never a protobuf in the first place. |
|
|
|
* @return this |
|
|
|
* @return this |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
@CanIgnoreReturnValue |
|
|
|
Builder mergeFrom(byte[] data, int off, int len, ExtensionRegistryLite extensionRegistry) |
|
|
|
Builder mergeFrom(byte[] data, int off, int len, ExtensionRegistryLite extensionRegistry) |
|
|
|
throws InvalidProtocolBufferException; |
|
|
|
throws InvalidProtocolBufferException; |
|
|
|
|
|
|
|
|
|
|
@ -283,12 +293,13 @@ public interface MessageLite extends MessageLiteOrBuilder { |
|
|
|
* |
|
|
|
* |
|
|
|
* <p>Despite usually reading the entire input, this does not close the stream. |
|
|
|
* <p>Despite usually reading the entire input, this does not close the stream. |
|
|
|
* |
|
|
|
* |
|
|
|
* @throws InvalidProtocolBufferException the bytes read are not syntactically correct |
|
|
|
* @throws InvalidProtocolBufferException the bytes read are not syntactically correct according |
|
|
|
* according to the protobuf wire format specification. The data is corrupt, incomplete, |
|
|
|
* to the protobuf wire format specification. The data is corrupt, incomplete, or was never |
|
|
|
* or was never a protobuf in the first place. |
|
|
|
* a protobuf in the first place. |
|
|
|
* @throws IOException an I/O error reading from the stream |
|
|
|
* @throws IOException an I/O error reading from the stream |
|
|
|
* @return this |
|
|
|
* @return this |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
@CanIgnoreReturnValue |
|
|
|
Builder mergeFrom(InputStream input) throws IOException; |
|
|
|
Builder mergeFrom(InputStream input) throws IOException; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -298,6 +309,7 @@ public interface MessageLite extends MessageLiteOrBuilder { |
|
|
|
* |
|
|
|
* |
|
|
|
* @return this |
|
|
|
* @return this |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
@CanIgnoreReturnValue |
|
|
|
Builder mergeFrom(InputStream input, ExtensionRegistryLite extensionRegistry) |
|
|
|
Builder mergeFrom(InputStream input, ExtensionRegistryLite extensionRegistry) |
|
|
|
throws IOException; |
|
|
|
throws IOException; |
|
|
|
|
|
|
|
|
|
|
@ -317,6 +329,7 @@ public interface MessageLite extends MessageLiteOrBuilder { |
|
|
|
* |
|
|
|
* |
|
|
|
* <p>This is equivalent to the {@code Message::MergeFrom} method in C++. |
|
|
|
* <p>This is equivalent to the {@code Message::MergeFrom} method in C++. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
@CanIgnoreReturnValue |
|
|
|
Builder mergeFrom(MessageLite other); |
|
|
|
Builder mergeFrom(MessageLite other); |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -326,11 +339,12 @@ public interface MessageLite extends MessageLiteOrBuilder { |
|
|
|
* |
|
|
|
* |
|
|
|
* @return true if successful, or false if the stream is at EOF when the method starts. Any |
|
|
|
* @return true if successful, or false if the stream is at EOF when the method starts. Any |
|
|
|
* other error (including reaching EOF during parsing) causes an exception to be thrown. |
|
|
|
* other error (including reaching EOF during parsing) causes an exception to be thrown. |
|
|
|
* @throws InvalidProtocolBufferException the bytes read are not syntactically correct |
|
|
|
* @throws InvalidProtocolBufferException the bytes read are not syntactically correct according |
|
|
|
* according to the protobuf wire format specification. The data is corrupt, incomplete, |
|
|
|
* to the protobuf wire format specification. The data is corrupt, incomplete, or was never |
|
|
|
* or was never a protobuf in the first place. |
|
|
|
* a protobuf in the first place. |
|
|
|
* @throws IOException an I/O error reading from the stream |
|
|
|
* @throws IOException an I/O error reading from the stream |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
@CanIgnoreReturnValue // TODO(kak): should this be @CheckReturnValue instead?
|
|
|
|
boolean mergeDelimitedFrom(InputStream input) throws IOException; |
|
|
|
boolean mergeDelimitedFrom(InputStream input) throws IOException; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -338,11 +352,12 @@ public interface MessageLite extends MessageLiteOrBuilder { |
|
|
|
* |
|
|
|
* |
|
|
|
* @return true if successful, or false if the stream is at EOF when the method starts. Any |
|
|
|
* @return true if successful, or false if the stream is at EOF when the method starts. Any |
|
|
|
* other error (including reaching EOF during parsing) causes an exception to be thrown. |
|
|
|
* other error (including reaching EOF during parsing) causes an exception to be thrown. |
|
|
|
* @throws InvalidProtocolBufferException the bytes read are not syntactically correct |
|
|
|
* @throws InvalidProtocolBufferException the bytes read are not syntactically correct according |
|
|
|
* according to the protobuf wire format specification. The data is corrupt, incomplete, |
|
|
|
* to the protobuf wire format specification. The data is corrupt, incomplete, or was never |
|
|
|
* or was never a protobuf in the first place. |
|
|
|
* a protobuf in the first place. |
|
|
|
* @throws IOException an I/O error reading from the stream |
|
|
|
* @throws IOException an I/O error reading from the stream |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
@CanIgnoreReturnValue // TODO(kak): should this be @CheckReturnValue instead?
|
|
|
|
boolean mergeDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry) |
|
|
|
boolean mergeDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry) |
|
|
|
throws IOException; |
|
|
|
throws IOException; |
|
|
|
} |
|
|
|
} |
|
|
|