public Builder mergeFrom(org.apache.calcite.avatica.proto.Requests.PrepareRequest other) { if (other == org.apache.calcite.avatica.proto.Requests.PrepareRequest.getDefaultInstance()) return this; if (!other.getConnectionId().isEmpty()) { connectionId_ = other.connectionId_; onChanged(); } if (!other.getSql().isEmpty()) { sql_ = other.sql_; onChanged(); } if (other.getMaxRowCount() != 0L) { setMaxRowCount(other.getMaxRowCount()); } if (other.getMaxRowsTotal() != 0L) { setMaxRowsTotal(other.getMaxRowsTotal()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { org.apache.calcite.avatica.proto.Requests.PrepareRequest parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (org.apache.calcite.avatica.proto.Requests.PrepareRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; }
@Test public void testPrepareDeserialization() throws Exception { final String sql = "SELECT * FROM FOO"; final String connectionId = UUID.randomUUID().toString(); final long maxRowCount = 200L; // The "current" serialization strategy. Requests.PrepareRequest protoPrepare = Requests.PrepareRequest.newBuilder(). setConnectionId(connectionId).setSql(sql).setMaxRowsTotal(maxRowCount).build(); Service.PrepareRequest prepareReq = new Service.PrepareRequest().deserialize(protoPrepare); assertEquals(maxRowCount, prepareReq.maxRowCount); // The "old" serialization strategy. protoPrepare = Requests.PrepareRequest.newBuilder(). setConnectionId(connectionId).setSql(sql).setMaxRowCount(maxRowCount).build(); prepareReq = new Service.PrepareRequest().deserialize(protoPrepare); assertEquals(maxRowCount, prepareReq.maxRowCount); // Both the new and old provided should default to the new protoPrepare = Requests.PrepareRequest.newBuilder(). setConnectionId(connectionId).setSql(sql).setMaxRowCount(500L) .setMaxRowsTotal(maxRowCount).build(); prepareReq = new Service.PrepareRequest().deserialize(protoPrepare); assertEquals(maxRowCount, prepareReq.maxRowCount); }
@Test public void testPrepareDeserialization() throws Exception { final String sql = "SELECT * FROM FOO"; final String connectionId = UUID.randomUUID().toString(); final long maxRowCount = 200L; // The "current" serialization strategy. Requests.PrepareRequest protoPrepare = Requests.PrepareRequest.newBuilder(). setConnectionId(connectionId).setSql(sql).setMaxRowsTotal(maxRowCount).build(); Service.PrepareRequest prepareReq = new Service.PrepareRequest().deserialize(protoPrepare); assertEquals(maxRowCount, prepareReq.maxRowCount); // The "old" serialization strategy. protoPrepare = Requests.PrepareRequest.newBuilder(). setConnectionId(connectionId).setSql(sql).setMaxRowCount(maxRowCount).build(); prepareReq = new Service.PrepareRequest().deserialize(protoPrepare); assertEquals(maxRowCount, prepareReq.maxRowCount); // Both the new and old provided should default to the new protoPrepare = Requests.PrepareRequest.newBuilder(). setConnectionId(connectionId).setSql(sql).setMaxRowCount(500L) .setMaxRowsTotal(maxRowCount).build(); prepareReq = new Service.PrepareRequest().deserialize(protoPrepare); assertEquals(maxRowCount, prepareReq.maxRowCount); }
public Builder mergeFrom(org.apache.calcite.avatica.proto.Requests.PrepareRequest other) { if (other == org.apache.calcite.avatica.proto.Requests.PrepareRequest.getDefaultInstance()) return this; if (!other.getConnectionId().isEmpty()) { connectionId_ = other.connectionId_; onChanged(); } if (!other.getSql().isEmpty()) { sql_ = other.sql_; onChanged(); } if (other.getMaxRowCount() != 0L) { setMaxRowCount(other.getMaxRowCount()); } if (other.getMaxRowsTotal() != 0L) { setMaxRowsTotal(other.getMaxRowsTotal()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { org.apache.calcite.avatica.proto.Requests.PrepareRequest parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (org.apache.calcite.avatica.proto.Requests.PrepareRequest) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; }
public Builder mergeFrom(org.apache.calcite.avatica.proto.Requests.PrepareRequest other) { if (other == org.apache.calcite.avatica.proto.Requests.PrepareRequest.getDefaultInstance()) return this; if (!other.getConnectionId().isEmpty()) { connectionId_ = other.connectionId_; onChanged(); } if (!other.getSql().isEmpty()) { sql_ = other.sql_; onChanged(); } if (other.getMaxRowCount() != 0L) { setMaxRowCount(other.getMaxRowCount()); } onChanged(); return this; }
@java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { org.apache.calcite.avatica.proto.Requests.PrepareRequest parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (org.apache.calcite.avatica.proto.Requests.PrepareRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; }
private Builder() { maybeForceBuilderInitialization(); }
public static Builder newBuilder(org.apache.calcite.avatica.proto.Requests.PrepareRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } public Builder toBuilder() {
private Builder() { maybeForceBuilderInitialization(); }
@java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /**
@java.lang.Override public org.apache.calcite.avatica.proto.Requests.PrepareRequest buildPartial() { org.apache.calcite.avatica.proto.Requests.PrepareRequest result = new org.apache.calcite.avatica.proto.Requests.PrepareRequest(this); result.connectionId_ = connectionId_; result.sql_ = sql_; result.maxRowCount_ = maxRowCount_; result.maxRowsTotal_ = maxRowsTotal_; onBuilt(); return result; }
public static Builder newBuilder(org.apache.calcite.avatica.proto.Requests.PrepareRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof org.apache.calcite.avatica.proto.Requests.PrepareRequest) { return mergeFrom((org.apache.calcite.avatica.proto.Requests.PrepareRequest)other); } else { super.mergeFrom(other); return this; } }
@java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /**
private Builder() { maybeForceBuilderInitialization(); }
@Override Requests.PrepareRequest serialize() { Requests.PrepareRequest.Builder builder = Requests.PrepareRequest.newBuilder(); if (null != connectionId) { builder.setConnectionId(connectionId); } if (null != sql) { builder.setSql(sql); } // Set both field for backwards compatibility return builder.setMaxRowCount(maxRowCount).setMaxRowsTotal(maxRowCount).build(); }
public static Builder newBuilder(org.apache.calcite.avatica.proto.Requests.PrepareRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override