diff --git a/protos/passenger-count.proto b/protos/passenger-count.proto index fdc6a98..49cd48e 100644 --- a/protos/passenger-count.proto +++ b/protos/passenger-count.proto @@ -10,6 +10,9 @@ message Data { optional string topic = 2; required Payload payload = 3; optional int64 received_at = 4; + //This field contains randomized vehicle load ratio (+-5 percentage points) that should be used when publishing passenger count publicly to preserve user privacy + //This field should be used instead of adding randomization in different places to avoid making statistical analysis possible + optional double randomizedVehicleLoadRatio = 5; } message Payload { diff --git a/src/main/java/fi/hsl/common/passengercount/proto/PassengerCount.java b/src/main/java/fi/hsl/common/passengercount/proto/PassengerCount.java index 6523226..b54b7e4 100644 --- a/src/main/java/fi/hsl/common/passengercount/proto/PassengerCount.java +++ b/src/main/java/fi/hsl/common/passengercount/proto/PassengerCount.java @@ -71,6 +71,27 @@ public interface DataOrBuilder extends * @return The receivedAt. */ long getReceivedAt(); + + /** + *
+ *This field contains randomized vehicle load ratio (+-5 percentage points) that should be used when publishing passenger count publicly to preserve user privacy + *This field should be used instead of adding randomization in different places to avoid making statistical analysis possible + *+ * + *
optional double randomizedVehicleLoadRatio = 5;
+ * @return Whether the randomizedVehicleLoadRatio field is set.
+ */
+ boolean hasRandomizedVehicleLoadRatio();
+ /**
+ * + *This field contains randomized vehicle load ratio (+-5 percentage points) that should be used when publishing passenger count publicly to preserve user privacy + *This field should be used instead of adding randomization in different places to avoid making statistical analysis possible + *+ * + *
optional double randomizedVehicleLoadRatio = 5;
+ * @return The randomizedVehicleLoadRatio.
+ */
+ double getRandomizedVehicleLoadRatio();
}
/**
* Protobuf type {@code proto.Data}
@@ -101,75 +122,6 @@ protected java.lang.Object newInstance(
getUnknownFields() {
return this.unknownFields;
}
- private Data(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- this();
- if (extensionRegistry == null) {
- throw new java.lang.NullPointerException();
- }
- int mutable_bitField0_ = 0;
- com.google.protobuf.UnknownFieldSet.Builder unknownFields =
- com.google.protobuf.UnknownFieldSet.newBuilder();
- try {
- boolean done = false;
- while (!done) {
- int tag = input.readTag();
- switch (tag) {
- case 0:
- done = true;
- break;
- case 8: {
- bitField0_ |= 0x00000001;
- schemaVersion_ = input.readInt32();
- break;
- }
- case 18: {
- com.google.protobuf.ByteString bs = input.readBytes();
- bitField0_ |= 0x00000002;
- topic_ = bs;
- break;
- }
- case 26: {
- fi.hsl.common.passengercount.proto.PassengerCount.Payload.Builder subBuilder = null;
- if (((bitField0_ & 0x00000004) != 0)) {
- subBuilder = payload_.toBuilder();
- }
- payload_ = input.readMessage(fi.hsl.common.passengercount.proto.PassengerCount.Payload.PARSER, extensionRegistry);
- if (subBuilder != null) {
- subBuilder.mergeFrom(payload_);
- payload_ = subBuilder.buildPartial();
- }
- bitField0_ |= 0x00000004;
- break;
- }
- case 32: {
- bitField0_ |= 0x00000008;
- receivedAt_ = input.readInt64();
- break;
- }
- default: {
- if (!parseUnknownField(
- input, unknownFields, extensionRegistry, tag)) {
- done = true;
- }
- break;
- }
- }
- }
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- throw e.setUnfinishedMessage(this);
- } catch (com.google.protobuf.UninitializedMessageException e) {
- throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
- } catch (java.io.IOException e) {
- throw new com.google.protobuf.InvalidProtocolBufferException(
- e).setUnfinishedMessage(this);
- } finally {
- this.unknownFields = unknownFields.build();
- makeExtensionsImmutable();
- }
- }
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return fi.hsl.common.passengercount.proto.PassengerCount.internal_static_proto_Data_descriptor;
@@ -296,6 +248,35 @@ public long getReceivedAt() {
return receivedAt_;
}
+ public static final int RANDOMIZEDVEHICLELOADRATIO_FIELD_NUMBER = 5;
+ private double randomizedVehicleLoadRatio_;
+ /**
+ * + *This field contains randomized vehicle load ratio (+-5 percentage points) that should be used when publishing passenger count publicly to preserve user privacy + *This field should be used instead of adding randomization in different places to avoid making statistical analysis possible + *+ * + *
optional double randomizedVehicleLoadRatio = 5;
+ * @return Whether the randomizedVehicleLoadRatio field is set.
+ */
+ @java.lang.Override
+ public boolean hasRandomizedVehicleLoadRatio() {
+ return ((bitField0_ & 0x00000010) != 0);
+ }
+ /**
+ * + *This field contains randomized vehicle load ratio (+-5 percentage points) that should be used when publishing passenger count publicly to preserve user privacy + *This field should be used instead of adding randomization in different places to avoid making statistical analysis possible + *+ * + *
optional double randomizedVehicleLoadRatio = 5;
+ * @return The randomizedVehicleLoadRatio.
+ */
+ @java.lang.Override
+ public double getRandomizedVehicleLoadRatio() {
+ return randomizedVehicleLoadRatio_;
+ }
+
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
@@ -330,7 +311,10 @@ public void writeTo(com.google.protobuf.CodedOutputStream output)
if (((bitField0_ & 0x00000008) != 0)) {
output.writeInt64(4, receivedAt_);
}
- unknownFields.writeTo(output);
+ if (((bitField0_ & 0x00000010) != 0)) {
+ output.writeDouble(5, randomizedVehicleLoadRatio_);
+ }
+ getUnknownFields().writeTo(output);
}
@java.lang.Override
@@ -354,7 +338,11 @@ public int getSerializedSize() {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(4, receivedAt_);
}
- size += unknownFields.getSerializedSize();
+ if (((bitField0_ & 0x00000010) != 0)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeDoubleSize(5, randomizedVehicleLoadRatio_);
+ }
+ size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@@ -389,7 +377,13 @@ public boolean equals(final java.lang.Object obj) {
if (getReceivedAt()
!= other.getReceivedAt()) return false;
}
- if (!unknownFields.equals(other.unknownFields)) return false;
+ if (hasRandomizedVehicleLoadRatio() != other.hasRandomizedVehicleLoadRatio()) return false;
+ if (hasRandomizedVehicleLoadRatio()) {
+ if (java.lang.Double.doubleToLongBits(getRandomizedVehicleLoadRatio())
+ != java.lang.Double.doubleToLongBits(
+ other.getRandomizedVehicleLoadRatio())) return false;
+ }
+ if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@@ -417,7 +411,12 @@ public int hashCode() {
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getReceivedAt());
}
- hash = (29 * hash) + unknownFields.hashCode();
+ if (hasRandomizedVehicleLoadRatio()) {
+ hash = (37 * hash) + RANDOMIZEDVEHICLELOADRATIO_FIELD_NUMBER;
+ hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
+ java.lang.Double.doubleToLongBits(getRandomizedVehicleLoadRatio()));
+ }
+ hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
@@ -563,6 +562,8 @@ public Builder clear() {
bitField0_ = (bitField0_ & ~0x00000004);
receivedAt_ = 0L;
bitField0_ = (bitField0_ & ~0x00000008);
+ randomizedVehicleLoadRatio_ = 0D;
+ bitField0_ = (bitField0_ & ~0x00000010);
return this;
}
@@ -611,6 +612,10 @@ public fi.hsl.common.passengercount.proto.PassengerCount.Data buildPartial() {
result.receivedAt_ = receivedAt_;
to_bitField0_ |= 0x00000008;
}
+ if (((from_bitField0_ & 0x00000010) != 0)) {
+ result.randomizedVehicleLoadRatio_ = randomizedVehicleLoadRatio_;
+ to_bitField0_ |= 0x00000010;
+ }
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
@@ -674,7 +679,10 @@ public Builder mergeFrom(fi.hsl.common.passengercount.proto.PassengerCount.Data
if (other.hasReceivedAt()) {
setReceivedAt(other.getReceivedAt());
}
- this.mergeUnknownFields(other.unknownFields);
+ if (other.hasRandomizedVehicleLoadRatio()) {
+ setRandomizedVehicleLoadRatio(other.getRandomizedVehicleLoadRatio());
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@@ -695,17 +703,57 @@ public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
- fi.hsl.common.passengercount.proto.PassengerCount.Data parsedMessage = null;
+ if (extensionRegistry == null) {
+ throw new java.lang.NullPointerException();
+ }
try {
- parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ case 8: {
+ schemaVersion_ = input.readInt32();
+ bitField0_ |= 0x00000001;
+ break;
+ } // case 8
+ case 18: {
+ topic_ = input.readBytes();
+ bitField0_ |= 0x00000002;
+ break;
+ } // case 18
+ case 26: {
+ input.readMessage(
+ getPayloadFieldBuilder().getBuilder(),
+ extensionRegistry);
+ bitField0_ |= 0x00000004;
+ break;
+ } // case 26
+ case 32: {
+ receivedAt_ = input.readInt64();
+ bitField0_ |= 0x00000008;
+ break;
+ } // case 32
+ case 41: {
+ randomizedVehicleLoadRatio_ = input.readDouble();
+ bitField0_ |= 0x00000010;
+ break;
+ } // case 41
+ default: {
+ if (!super.parseUnknownField(input, extensionRegistry, tag)) {
+ done = true; // was an endgroup tag
+ }
+ break;
+ } // default:
+ } // switch (tag)
+ } // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
- parsedMessage = (fi.hsl.common.passengercount.proto.PassengerCount.Data) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
- if (parsedMessage != null) {
- mergeFrom(parsedMessage);
- }
- }
+ onChanged();
+ } // finally
return this;
}
private int bitField0_;
@@ -991,6 +1039,65 @@ public Builder clearReceivedAt() {
onChanged();
return this;
}
+
+ private double randomizedVehicleLoadRatio_ ;
+ /**
+ * + *This field contains randomized vehicle load ratio (+-5 percentage points) that should be used when publishing passenger count publicly to preserve user privacy + *This field should be used instead of adding randomization in different places to avoid making statistical analysis possible + *+ * + *
optional double randomizedVehicleLoadRatio = 5;
+ * @return Whether the randomizedVehicleLoadRatio field is set.
+ */
+ @java.lang.Override
+ public boolean hasRandomizedVehicleLoadRatio() {
+ return ((bitField0_ & 0x00000010) != 0);
+ }
+ /**
+ * + *This field contains randomized vehicle load ratio (+-5 percentage points) that should be used when publishing passenger count publicly to preserve user privacy + *This field should be used instead of adding randomization in different places to avoid making statistical analysis possible + *+ * + *
optional double randomizedVehicleLoadRatio = 5;
+ * @return The randomizedVehicleLoadRatio.
+ */
+ @java.lang.Override
+ public double getRandomizedVehicleLoadRatio() {
+ return randomizedVehicleLoadRatio_;
+ }
+ /**
+ * + *This field contains randomized vehicle load ratio (+-5 percentage points) that should be used when publishing passenger count publicly to preserve user privacy + *This field should be used instead of adding randomization in different places to avoid making statistical analysis possible + *+ * + *
optional double randomizedVehicleLoadRatio = 5;
+ * @param value The randomizedVehicleLoadRatio to set.
+ * @return This builder for chaining.
+ */
+ public Builder setRandomizedVehicleLoadRatio(double value) {
+ bitField0_ |= 0x00000010;
+ randomizedVehicleLoadRatio_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * + *This field contains randomized vehicle load ratio (+-5 percentage points) that should be used when publishing passenger count publicly to preserve user privacy + *This field should be used instead of adding randomization in different places to avoid making statistical analysis possible + *+ * + *
optional double randomizedVehicleLoadRatio = 5;
+ * @return This builder for chaining.
+ */
+ public Builder clearRandomizedVehicleLoadRatio() {
+ bitField0_ = (bitField0_ & ~0x00000010);
+ randomizedVehicleLoadRatio_ = 0D;
+ onChanged();
+ return this;
+ }
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
@@ -1024,7 +1131,18 @@ public Data parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
- return new Data(input, extensionRegistry);
+ Builder builder = newBuilder();
+ try {
+ builder.mergeFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(builder.buildPartial());
+ } catch (com.google.protobuf.UninitializedMessageException e) {
+ throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(e)
+ .setUnfinishedMessage(builder.buildPartial());
+ }
+ return builder.buildPartial();
}
};
@@ -1308,145 +1426,6 @@ protected java.lang.Object newInstance(
getUnknownFields() {
return this.unknownFields;
}
- private Payload(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- this();
- if (extensionRegistry == null) {
- throw new java.lang.NullPointerException();
- }
- int mutable_bitField0_ = 0;
- com.google.protobuf.UnknownFieldSet.Builder unknownFields =
- com.google.protobuf.UnknownFieldSet.newBuilder();
- try {
- boolean done = false;
- while (!done) {
- int tag = input.readTag();
- switch (tag) {
- case 0:
- done = true;
- break;
- case 10: {
- com.google.protobuf.ByteString bs = input.readBytes();
- bitField0_ |= 0x00000001;
- desi_ = bs;
- break;
- }
- case 18: {
- com.google.protobuf.ByteString bs = input.readBytes();
- bitField0_ |= 0x00000002;
- dir_ = bs;
- break;
- }
- case 24: {
- bitField0_ |= 0x00000004;
- oper_ = input.readInt32();
- break;
- }
- case 32: {
- bitField0_ |= 0x00000008;
- veh_ = input.readInt32();
- break;
- }
- case 40: {
- bitField0_ |= 0x00000010;
- tst_ = input.readInt64();
- break;
- }
- case 48: {
- bitField0_ |= 0x00000020;
- tsi_ = input.readInt64();
- break;
- }
- case 57: {
- bitField0_ |= 0x00000040;
- lat_ = input.readDouble();
- break;
- }
- case 65: {
- bitField0_ |= 0x00000080;
- long_ = input.readDouble();
- break;
- }
- case 73: {
- bitField0_ |= 0x00000100;
- odo_ = input.readDouble();
- break;
- }
- case 82: {
- com.google.protobuf.ByteString bs = input.readBytes();
- bitField0_ |= 0x00000200;
- oday_ = bs;
- break;
- }
- case 88: {
- bitField0_ |= 0x00000400;
- jrn_ = input.readInt32();
- break;
- }
- case 96: {
- bitField0_ |= 0x00000800;
- line_ = input.readInt32();
- break;
- }
- case 106: {
- com.google.protobuf.ByteString bs = input.readBytes();
- bitField0_ |= 0x00001000;
- start_ = bs;
- break;
- }
- case 114: {
- com.google.protobuf.ByteString bs = input.readBytes();
- bitField0_ |= 0x00002000;
- loc_ = bs;
- break;
- }
- case 120: {
- bitField0_ |= 0x00004000;
- stop_ = input.readInt32();
- break;
- }
- case 130: {
- com.google.protobuf.ByteString bs = input.readBytes();
- bitField0_ |= 0x00008000;
- route_ = bs;
- break;
- }
- case 138: {
- fi.hsl.common.passengercount.proto.PassengerCount.VehicleCounts.Builder subBuilder = null;
- if (((bitField0_ & 0x00010000) != 0)) {
- subBuilder = vehicleCounts_.toBuilder();
- }
- vehicleCounts_ = input.readMessage(fi.hsl.common.passengercount.proto.PassengerCount.VehicleCounts.PARSER, extensionRegistry);
- if (subBuilder != null) {
- subBuilder.mergeFrom(vehicleCounts_);
- vehicleCounts_ = subBuilder.buildPartial();
- }
- bitField0_ |= 0x00010000;
- break;
- }
- default: {
- if (!parseUnknownField(
- input, unknownFields, extensionRegistry, tag)) {
- done = true;
- }
- break;
- }
- }
- }
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- throw e.setUnfinishedMessage(this);
- } catch (com.google.protobuf.UninitializedMessageException e) {
- throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
- } catch (java.io.IOException e) {
- throw new com.google.protobuf.InvalidProtocolBufferException(
- e).setUnfinishedMessage(this);
- } finally {
- this.unknownFields = unknownFields.build();
- makeExtensionsImmutable();
- }
- }
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return fi.hsl.common.passengercount.proto.PassengerCount.internal_static_proto_Payload_descriptor;
@@ -2030,7 +2009,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output)
if (((bitField0_ & 0x00010000) != 0)) {
output.writeMessage(17, getVehicleCounts());
}
- unknownFields.writeTo(output);
+ getUnknownFields().writeTo(output);
}
@java.lang.Override
@@ -2101,7 +2080,7 @@ public int getSerializedSize() {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(17, getVehicleCounts());
}
- size += unknownFields.getSerializedSize();
+ size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@@ -2204,7 +2183,7 @@ public boolean equals(final java.lang.Object obj) {
if (!getVehicleCounts()
.equals(other.getVehicleCounts())) return false;
}
- if (!unknownFields.equals(other.unknownFields)) return false;
+ if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@@ -2288,7 +2267,7 @@ public int hashCode() {
hash = (37 * hash) + VEHICLECOUNTS_FIELD_NUMBER;
hash = (53 * hash) + getVehicleCounts().hashCode();
}
- hash = (29 * hash) + unknownFields.hashCode();
+ hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
@@ -2672,7 +2651,7 @@ public Builder mergeFrom(fi.hsl.common.passengercount.proto.PassengerCount.Paylo
if (other.hasVehicleCounts()) {
mergeVehicleCounts(other.getVehicleCounts());
}
- this.mergeUnknownFields(other.unknownFields);
+ this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@@ -2687,17 +2666,117 @@ public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
- fi.hsl.common.passengercount.proto.PassengerCount.Payload parsedMessage = null;
+ if (extensionRegistry == null) {
+ throw new java.lang.NullPointerException();
+ }
try {
- parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ case 10: {
+ desi_ = input.readBytes();
+ bitField0_ |= 0x00000001;
+ break;
+ } // case 10
+ case 18: {
+ dir_ = input.readBytes();
+ bitField0_ |= 0x00000002;
+ break;
+ } // case 18
+ case 24: {
+ oper_ = input.readInt32();
+ bitField0_ |= 0x00000004;
+ break;
+ } // case 24
+ case 32: {
+ veh_ = input.readInt32();
+ bitField0_ |= 0x00000008;
+ break;
+ } // case 32
+ case 40: {
+ tst_ = input.readInt64();
+ bitField0_ |= 0x00000010;
+ break;
+ } // case 40
+ case 48: {
+ tsi_ = input.readInt64();
+ bitField0_ |= 0x00000020;
+ break;
+ } // case 48
+ case 57: {
+ lat_ = input.readDouble();
+ bitField0_ |= 0x00000040;
+ break;
+ } // case 57
+ case 65: {
+ long_ = input.readDouble();
+ bitField0_ |= 0x00000080;
+ break;
+ } // case 65
+ case 73: {
+ odo_ = input.readDouble();
+ bitField0_ |= 0x00000100;
+ break;
+ } // case 73
+ case 82: {
+ oday_ = input.readBytes();
+ bitField0_ |= 0x00000200;
+ break;
+ } // case 82
+ case 88: {
+ jrn_ = input.readInt32();
+ bitField0_ |= 0x00000400;
+ break;
+ } // case 88
+ case 96: {
+ line_ = input.readInt32();
+ bitField0_ |= 0x00000800;
+ break;
+ } // case 96
+ case 106: {
+ start_ = input.readBytes();
+ bitField0_ |= 0x00001000;
+ break;
+ } // case 106
+ case 114: {
+ loc_ = input.readBytes();
+ bitField0_ |= 0x00002000;
+ break;
+ } // case 114
+ case 120: {
+ stop_ = input.readInt32();
+ bitField0_ |= 0x00004000;
+ break;
+ } // case 120
+ case 130: {
+ route_ = input.readBytes();
+ bitField0_ |= 0x00008000;
+ break;
+ } // case 130
+ case 138: {
+ input.readMessage(
+ getVehicleCountsFieldBuilder().getBuilder(),
+ extensionRegistry);
+ bitField0_ |= 0x00010000;
+ break;
+ } // case 138
+ default: {
+ if (!super.parseUnknownField(input, extensionRegistry, tag)) {
+ done = true; // was an endgroup tag
+ }
+ break;
+ } // default:
+ } // switch (tag)
+ } // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
- parsedMessage = (fi.hsl.common.passengercount.proto.PassengerCount.Payload) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
- if (parsedMessage != null) {
- mergeFrom(parsedMessage);
- }
- }
+ onChanged();
+ } // finally
return this;
}
private int bitField0_;
@@ -3748,7 +3827,18 @@ public Payload parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
- return new Payload(input, extensionRegistry);
+ Builder builder = newBuilder();
+ try {
+ builder.mergeFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(builder.buildPartial());
+ } catch (com.google.protobuf.UninitializedMessageException e) {
+ throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(e)
+ .setUnfinishedMessage(builder.buildPartial());
+ }
+ return builder.buildPartial();
}
};
@@ -3882,80 +3972,6 @@ protected java.lang.Object newInstance(
getUnknownFields() {
return this.unknownFields;
}
- private VehicleCounts(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- this();
- if (extensionRegistry == null) {
- throw new java.lang.NullPointerException();
- }
- int mutable_bitField0_ = 0;
- com.google.protobuf.UnknownFieldSet.Builder unknownFields =
- com.google.protobuf.UnknownFieldSet.newBuilder();
- try {
- boolean done = false;
- while (!done) {
- int tag = input.readTag();
- switch (tag) {
- case 0:
- done = true;
- break;
- case 10: {
- com.google.protobuf.ByteString bs = input.readBytes();
- bitField0_ |= 0x00000001;
- countQuality_ = bs;
- break;
- }
- case 16: {
- bitField0_ |= 0x00000002;
- vehicleLoad_ = input.readInt32();
- break;
- }
- case 25: {
- bitField0_ |= 0x00000004;
- vehicleLoadRatio_ = input.readDouble();
- break;
- }
- case 34: {
- if (!((mutable_bitField0_ & 0x00000008) != 0)) {
- doorCounts_ = new java.util.ArrayList