/src/test/java/tap/formats/tapproto/Testmsg.java
https://github.com/dmoore247/tap · Java · 380 lines · 331 code · 38 blank · 11 comment · 30 complexity · 2e0f85304aeae00ea26275a6891db1b5 MD5 · raw file
- // Generated by the protocol buffer compiler. DO NOT EDIT!
- // source: testmsg.proto
- package tap.formats.tapproto;
- public final class Testmsg {
- private Testmsg() {}
- public static void registerAllExtensions(
- com.google.protobuf.ExtensionRegistry registry) {
- }
- public static final class TestMsg extends
- com.google.protobuf.GeneratedMessage {
- // Use TestMsg.newBuilder() to construct.
- private TestMsg() {
- initFields();
- }
- private TestMsg(boolean noInit) {}
-
- private static final TestMsg defaultInstance;
- public static TestMsg getDefaultInstance() {
- return defaultInstance;
- }
-
- public TestMsg getDefaultInstanceForType() {
- return defaultInstance;
- }
-
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return tap.formats.tapproto.Testmsg.internal_static_tap_formats_tapproto_TestMsg_descriptor;
- }
-
- protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return tap.formats.tapproto.Testmsg.internal_static_tap_formats_tapproto_TestMsg_fieldAccessorTable;
- }
-
- // optional int32 size = 1;
- public static final int SIZE_FIELD_NUMBER = 1;
- private boolean hasSize;
- private int size_ = 0;
- public boolean hasSize() { return hasSize; }
- public int getSize() { return size_; }
-
- // required string data = 2;
- public static final int DATA_FIELD_NUMBER = 2;
- private boolean hasData;
- private java.lang.String data_ = "";
- public boolean hasData() { return hasData; }
- public java.lang.String getData() { return data_; }
-
- private void initFields() {
- }
- public final boolean isInitialized() {
- if (!hasData) return false;
- return true;
- }
-
- public void writeTo(com.google.protobuf.CodedOutputStream output)
- throws java.io.IOException {
- getSerializedSize();
- if (hasSize()) {
- output.writeInt32(1, getSize());
- }
- if (hasData()) {
- output.writeString(2, getData());
- }
- getUnknownFields().writeTo(output);
- }
-
- private int memoizedSerializedSize = -1;
- public int getSerializedSize() {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
-
- size = 0;
- if (hasSize()) {
- size += com.google.protobuf.CodedOutputStream
- .computeInt32Size(1, getSize());
- }
- if (hasData()) {
- size += com.google.protobuf.CodedOutputStream
- .computeStringSize(2, getData());
- }
- size += getUnknownFields().getSerializedSize();
- memoizedSerializedSize = size;
- return size;
- }
-
- public static tap.formats.tapproto.Testmsg.TestMsg parseFrom(
- com.google.protobuf.ByteString data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return newBuilder().mergeFrom(data).buildParsed();
- }
- public static tap.formats.tapproto.Testmsg.TestMsg parseFrom(
- com.google.protobuf.ByteString data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return newBuilder().mergeFrom(data, extensionRegistry)
- .buildParsed();
- }
- public static tap.formats.tapproto.Testmsg.TestMsg parseFrom(byte[] data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return newBuilder().mergeFrom(data).buildParsed();
- }
- public static tap.formats.tapproto.Testmsg.TestMsg parseFrom(
- byte[] data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return newBuilder().mergeFrom(data, extensionRegistry)
- .buildParsed();
- }
- public static tap.formats.tapproto.Testmsg.TestMsg parseFrom(java.io.InputStream input)
- throws java.io.IOException {
- return newBuilder().mergeFrom(input).buildParsed();
- }
- public static tap.formats.tapproto.Testmsg.TestMsg parseFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return newBuilder().mergeFrom(input, extensionRegistry)
- .buildParsed();
- }
- public static tap.formats.tapproto.Testmsg.TestMsg parseDelimitedFrom(java.io.InputStream input)
- throws java.io.IOException {
- Builder builder = newBuilder();
- if (builder.mergeDelimitedFrom(input)) {
- return builder.buildParsed();
- } else {
- return null;
- }
- }
- public static tap.formats.tapproto.Testmsg.TestMsg parseDelimitedFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- Builder builder = newBuilder();
- if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
- return builder.buildParsed();
- } else {
- return null;
- }
- }
- public static tap.formats.tapproto.Testmsg.TestMsg parseFrom(
- com.google.protobuf.CodedInputStream input)
- throws java.io.IOException {
- return newBuilder().mergeFrom(input).buildParsed();
- }
- public static tap.formats.tapproto.Testmsg.TestMsg parseFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return newBuilder().mergeFrom(input, extensionRegistry)
- .buildParsed();
- }
-
- public static Builder newBuilder() { return Builder.create(); }
- public Builder newBuilderForType() { return newBuilder(); }
- public static Builder newBuilder(tap.formats.tapproto.Testmsg.TestMsg prototype) {
- return newBuilder().mergeFrom(prototype);
- }
- public Builder toBuilder() { return newBuilder(this); }
-
- public static final class Builder extends
- com.google.protobuf.GeneratedMessage.Builder<Builder> {
- private tap.formats.tapproto.Testmsg.TestMsg result;
-
- // Construct using tap.formats.tapproto.Testmsg.TestMsg.newBuilder()
- private Builder() {}
-
- private static Builder create() {
- Builder builder = new Builder();
- builder.result = new tap.formats.tapproto.Testmsg.TestMsg();
- return builder;
- }
-
- protected tap.formats.tapproto.Testmsg.TestMsg internalGetResult() {
- return result;
- }
-
- public Builder clear() {
- if (result == null) {
- throw new IllegalStateException(
- "Cannot call clear() after build().");
- }
- result = new tap.formats.tapproto.Testmsg.TestMsg();
- return this;
- }
-
- public Builder clone() {
- return create().mergeFrom(result);
- }
-
- public com.google.protobuf.Descriptors.Descriptor
- getDescriptorForType() {
- return tap.formats.tapproto.Testmsg.TestMsg.getDescriptor();
- }
-
- public tap.formats.tapproto.Testmsg.TestMsg getDefaultInstanceForType() {
- return tap.formats.tapproto.Testmsg.TestMsg.getDefaultInstance();
- }
-
- public boolean isInitialized() {
- return result.isInitialized();
- }
- public tap.formats.tapproto.Testmsg.TestMsg build() {
- if (result != null && !isInitialized()) {
- throw newUninitializedMessageException(result);
- }
- return buildPartial();
- }
-
- private tap.formats.tapproto.Testmsg.TestMsg buildParsed()
- throws com.google.protobuf.InvalidProtocolBufferException {
- if (!isInitialized()) {
- throw newUninitializedMessageException(
- result).asInvalidProtocolBufferException();
- }
- return buildPartial();
- }
-
- public tap.formats.tapproto.Testmsg.TestMsg buildPartial() {
- if (result == null) {
- throw new IllegalStateException(
- "build() has already been called on this Builder.");
- }
- tap.formats.tapproto.Testmsg.TestMsg returnMe = result;
- result = null;
- return returnMe;
- }
-
- public Builder mergeFrom(com.google.protobuf.Message other) {
- if (other instanceof tap.formats.tapproto.Testmsg.TestMsg) {
- return mergeFrom((tap.formats.tapproto.Testmsg.TestMsg)other);
- } else {
- super.mergeFrom(other);
- return this;
- }
- }
-
- public Builder mergeFrom(tap.formats.tapproto.Testmsg.TestMsg other) {
- if (other == tap.formats.tapproto.Testmsg.TestMsg.getDefaultInstance()) return this;
- if (other.hasSize()) {
- setSize(other.getSize());
- }
- if (other.hasData()) {
- setData(other.getData());
- }
- this.mergeUnknownFields(other.getUnknownFields());
- return this;
- }
-
- public Builder mergeFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- com.google.protobuf.UnknownFieldSet.Builder unknownFields =
- com.google.protobuf.UnknownFieldSet.newBuilder(
- this.getUnknownFields());
- while (true) {
- int tag = input.readTag();
- switch (tag) {
- case 0:
- this.setUnknownFields(unknownFields.build());
- return this;
- default: {
- if (!parseUnknownField(input, unknownFields,
- extensionRegistry, tag)) {
- this.setUnknownFields(unknownFields.build());
- return this;
- }
- break;
- }
- case 8: {
- setSize(input.readInt32());
- break;
- }
- case 18: {
- setData(input.readString());
- break;
- }
- }
- }
- }
-
-
- // optional int32 size = 1;
- public boolean hasSize() {
- return result.hasSize();
- }
- public int getSize() {
- return result.getSize();
- }
- public Builder setSize(int value) {
- result.hasSize = true;
- result.size_ = value;
- return this;
- }
- public Builder clearSize() {
- result.hasSize = false;
- result.size_ = 0;
- return this;
- }
-
- // required string data = 2;
- public boolean hasData() {
- return result.hasData();
- }
- public java.lang.String getData() {
- return result.getData();
- }
- public Builder setData(java.lang.String value) {
- if (value == null) {
- throw new NullPointerException();
- }
- result.hasData = true;
- result.data_ = value;
- return this;
- }
- public Builder clearData() {
- result.hasData = false;
- result.data_ = getDefaultInstance().getData();
- return this;
- }
-
- // @@protoc_insertion_point(builder_scope:tap.formats.tapproto.TestMsg)
- }
-
- static {
- defaultInstance = new TestMsg(true);
- tap.formats.tapproto.Testmsg.internalForceInit();
- defaultInstance.initFields();
- }
-
- // @@protoc_insertion_point(class_scope:tap.formats.tapproto.TestMsg)
- }
-
- private static com.google.protobuf.Descriptors.Descriptor
- internal_static_tap_formats_tapproto_TestMsg_descriptor;
- private static
- com.google.protobuf.GeneratedMessage.FieldAccessorTable
- internal_static_tap_formats_tapproto_TestMsg_fieldAccessorTable;
-
- public static com.google.protobuf.Descriptors.FileDescriptor
- getDescriptor() {
- return descriptor;
- }
- private static com.google.protobuf.Descriptors.FileDescriptor
- descriptor;
- static {
- java.lang.String[] descriptorData = {
- "\n\rtestmsg.proto\022\024tap.formats.tapproto\"%\n" +
- "\007TestMsg\022\014\n\004size\030\001 \001(\005\022\014\n\004data\030\002 \002(\t"
- };
- com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
- new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
- public com.google.protobuf.ExtensionRegistry assignDescriptors(
- com.google.protobuf.Descriptors.FileDescriptor root) {
- descriptor = root;
- internal_static_tap_formats_tapproto_TestMsg_descriptor =
- getDescriptor().getMessageTypes().get(0);
- internal_static_tap_formats_tapproto_TestMsg_fieldAccessorTable = new
- com.google.protobuf.GeneratedMessage.FieldAccessorTable(
- internal_static_tap_formats_tapproto_TestMsg_descriptor,
- new java.lang.String[] { "Size", "Data", },
- tap.formats.tapproto.Testmsg.TestMsg.class,
- tap.formats.tapproto.Testmsg.TestMsg.Builder.class);
- return null;
- }
- };
- com.google.protobuf.Descriptors.FileDescriptor
- .internalBuildGeneratedFileFrom(descriptorData,
- new com.google.protobuf.Descriptors.FileDescriptor[] {
- }, assigner);
- }
-
- public static void internalForceInit() {}
-
- // @@protoc_insertion_point(outer_class_scope)
- }