vpm.setVehicleLabel(vd.getLabel()); if (vd.hasLicensePlate()) { vpm.setVehicleLicensePlate(vd.getLicensePlate());
public Builder mergeFrom(com.google.transit.realtime.GtfsRealtime.VehicleDescriptor other) { if (other == com.google.transit.realtime.GtfsRealtime.VehicleDescriptor.getDefaultInstance()) return this; if (other.hasId()) { bitField0_ |= 0x00000001; id_ = other.id_; onChanged(); } if (other.hasLabel()) { bitField0_ |= 0x00000002; label_ = other.label_; onChanged(); } if (other.hasLicensePlate()) { bitField0_ |= 0x00000004; licensePlate_ = other.licensePlate_; onChanged(); } this.mergeExtensionFields(other); this.mergeUnknownFields(other.getUnknownFields()); return this; }
/** * Returns the vehicleID. Returns null if no VehicleDescription associated * with the vehicle or if no ID associated with the VehicleDescription. * * @param vehicle * @return vehicle ID or null if there isn't one */ private static String getLicensePlate(VehiclePosition vehicle) { if (!vehicle.hasVehicle()) { return null; } VehicleDescriptor desc = vehicle.getVehicle(); if (!desc.hasLicensePlate()) { return null; } return desc.getLicensePlate(); }
public Builder mergeFrom(com.google.transit.realtime.GtfsRealtime.VehicleDescriptor other) { if (other == com.google.transit.realtime.GtfsRealtime.VehicleDescriptor.getDefaultInstance()) return this; if (other.hasId()) { bitField0_ |= 0x00000001; id_ = other.id_; onChanged(); } if (other.hasLabel()) { bitField0_ |= 0x00000002; label_ = other.label_; onChanged(); } if (other.hasLicensePlate()) { bitField0_ |= 0x00000004; licensePlate_ = other.licensePlate_; onChanged(); } this.mergeExtensionFields(other); this.mergeUnknownFields(other.getUnknownFields()); return this; }