PageRenderTime 63ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 0ms

/MyTracksLib/src/com/google/android/apps/mytracks/content/Sensor.java

https://code.google.com/p/mytracks/
Java | 883 lines | 781 code | 76 blank | 26 comment | 97 complexity | 143d9c30bc45add29645e2d55a519063 MD5 | raw file
Possible License(s): BSD-3-Clause, Apache-2.0
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: proto/sensor.proto
  3. package com.google.android.apps.mytracks.content;
  4. public final class Sensor {
  5. private Sensor() {}
  6. public static void registerAllExtensions(
  7. com.google.protobuf.ExtensionRegistryLite registry) {
  8. }
  9. public enum SensorState
  10. implements com.google.protobuf.Internal.EnumLite {
  11. NONE(0, 1),
  12. CONNECTING(1, 2),
  13. CONNECTED(2, 3),
  14. DISCONNECTED(3, 4),
  15. SENDING(4, 5),
  16. ;
  17. public final int getNumber() { return value; }
  18. public static SensorState valueOf(int value) {
  19. switch (value) {
  20. case 1: return NONE;
  21. case 2: return CONNECTING;
  22. case 3: return CONNECTED;
  23. case 4: return DISCONNECTED;
  24. case 5: return SENDING;
  25. default: return null;
  26. }
  27. }
  28. public static com.google.protobuf.Internal.EnumLiteMap<SensorState>
  29. internalGetValueMap() {
  30. return internalValueMap;
  31. }
  32. private static com.google.protobuf.Internal.EnumLiteMap<SensorState>
  33. internalValueMap =
  34. new com.google.protobuf.Internal.EnumLiteMap<SensorState>() {
  35. public SensorState findValueByNumber(int number) {
  36. return SensorState.valueOf(number)
  37. ; }
  38. };
  39. private final int index;
  40. private final int value;
  41. private SensorState(int index, int value) {
  42. this.index = index;
  43. this.value = value;
  44. }
  45. // @@protoc_insertion_point(enum_scope:com.google.android.apps.mytracks.content.SensorState)
  46. }
  47. public static final class SensorData extends
  48. com.google.protobuf.GeneratedMessageLite {
  49. // Use SensorData.newBuilder() to construct.
  50. private SensorData() {
  51. initFields();
  52. }
  53. private SensorData(boolean noInit) {}
  54. private static final SensorData defaultInstance;
  55. public static SensorData getDefaultInstance() {
  56. return defaultInstance;
  57. }
  58. public SensorData getDefaultInstanceForType() {
  59. return defaultInstance;
  60. }
  61. // required .com.google.android.apps.mytracks.content.SensorState state = 1 [default = NONE];
  62. public static final int STATE_FIELD_NUMBER = 1;
  63. private boolean hasState;
  64. private com.google.android.apps.mytracks.content.Sensor.SensorState state_;
  65. public boolean hasState() { return hasState; }
  66. public com.google.android.apps.mytracks.content.Sensor.SensorState getState() { return state_; }
  67. // optional int32 value = 2;
  68. public static final int VALUE_FIELD_NUMBER = 2;
  69. private boolean hasValue;
  70. private int value_ = 0;
  71. public boolean hasValue() { return hasValue; }
  72. public int getValue() { return value_; }
  73. private void initFields() {
  74. state_ = com.google.android.apps.mytracks.content.Sensor.SensorState.NONE;
  75. }
  76. public final boolean isInitialized() {
  77. if (!hasState) return false;
  78. return true;
  79. }
  80. public void writeTo(com.google.protobuf.CodedOutputStream output)
  81. throws java.io.IOException {
  82. getSerializedSize();
  83. if (hasState()) {
  84. output.writeEnum(1, getState().getNumber());
  85. }
  86. if (hasValue()) {
  87. output.writeInt32(2, getValue());
  88. }
  89. }
  90. private int memoizedSerializedSize = -1;
  91. public int getSerializedSize() {
  92. int size = memoizedSerializedSize;
  93. if (size != -1) return size;
  94. size = 0;
  95. if (hasState()) {
  96. size += com.google.protobuf.CodedOutputStream
  97. .computeEnumSize(1, getState().getNumber());
  98. }
  99. if (hasValue()) {
  100. size += com.google.protobuf.CodedOutputStream
  101. .computeInt32Size(2, getValue());
  102. }
  103. memoizedSerializedSize = size;
  104. return size;
  105. }
  106. public static com.google.android.apps.mytracks.content.Sensor.SensorData parseFrom(
  107. com.google.protobuf.ByteString data)
  108. throws com.google.protobuf.InvalidProtocolBufferException {
  109. return newBuilder().mergeFrom(data).buildParsed();
  110. }
  111. public static com.google.android.apps.mytracks.content.Sensor.SensorData parseFrom(
  112. com.google.protobuf.ByteString data,
  113. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  114. throws com.google.protobuf.InvalidProtocolBufferException {
  115. return newBuilder().mergeFrom(data, extensionRegistry)
  116. .buildParsed();
  117. }
  118. public static com.google.android.apps.mytracks.content.Sensor.SensorData parseFrom(byte[] data)
  119. throws com.google.protobuf.InvalidProtocolBufferException {
  120. return newBuilder().mergeFrom(data).buildParsed();
  121. }
  122. public static com.google.android.apps.mytracks.content.Sensor.SensorData parseFrom(
  123. byte[] data,
  124. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  125. throws com.google.protobuf.InvalidProtocolBufferException {
  126. return newBuilder().mergeFrom(data, extensionRegistry)
  127. .buildParsed();
  128. }
  129. public static com.google.android.apps.mytracks.content.Sensor.SensorData parseFrom(java.io.InputStream input)
  130. throws java.io.IOException {
  131. return newBuilder().mergeFrom(input).buildParsed();
  132. }
  133. public static com.google.android.apps.mytracks.content.Sensor.SensorData parseFrom(
  134. java.io.InputStream input,
  135. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  136. throws java.io.IOException {
  137. return newBuilder().mergeFrom(input, extensionRegistry)
  138. .buildParsed();
  139. }
  140. public static com.google.android.apps.mytracks.content.Sensor.SensorData parseDelimitedFrom(java.io.InputStream input)
  141. throws java.io.IOException {
  142. Builder builder = newBuilder();
  143. if (builder.mergeDelimitedFrom(input)) {
  144. return builder.buildParsed();
  145. } else {
  146. return null;
  147. }
  148. }
  149. public static com.google.android.apps.mytracks.content.Sensor.SensorData parseDelimitedFrom(
  150. java.io.InputStream input,
  151. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  152. throws java.io.IOException {
  153. Builder builder = newBuilder();
  154. if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
  155. return builder.buildParsed();
  156. } else {
  157. return null;
  158. }
  159. }
  160. public static com.google.android.apps.mytracks.content.Sensor.SensorData parseFrom(
  161. com.google.protobuf.CodedInputStream input)
  162. throws java.io.IOException {
  163. return newBuilder().mergeFrom(input).buildParsed();
  164. }
  165. public static com.google.android.apps.mytracks.content.Sensor.SensorData parseFrom(
  166. com.google.protobuf.CodedInputStream input,
  167. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  168. throws java.io.IOException {
  169. return newBuilder().mergeFrom(input, extensionRegistry)
  170. .buildParsed();
  171. }
  172. public static Builder newBuilder() { return Builder.create(); }
  173. public Builder newBuilderForType() { return newBuilder(); }
  174. public static Builder newBuilder(com.google.android.apps.mytracks.content.Sensor.SensorData prototype) {
  175. return newBuilder().mergeFrom(prototype);
  176. }
  177. public Builder toBuilder() { return newBuilder(this); }
  178. public static final class Builder extends
  179. com.google.protobuf.GeneratedMessageLite.Builder<
  180. com.google.android.apps.mytracks.content.Sensor.SensorData, Builder> {
  181. private com.google.android.apps.mytracks.content.Sensor.SensorData result;
  182. // Construct using com.google.android.apps.mytracks.content.Sensor.SensorData.newBuilder()
  183. private Builder() {}
  184. private static Builder create() {
  185. Builder builder = new Builder();
  186. builder.result = new com.google.android.apps.mytracks.content.Sensor.SensorData();
  187. return builder;
  188. }
  189. protected com.google.android.apps.mytracks.content.Sensor.SensorData internalGetResult() {
  190. return result;
  191. }
  192. public Builder clear() {
  193. if (result == null) {
  194. throw new IllegalStateException(
  195. "Cannot call clear() after build().");
  196. }
  197. result = new com.google.android.apps.mytracks.content.Sensor.SensorData();
  198. return this;
  199. }
  200. public Builder clone() {
  201. return create().mergeFrom(result);
  202. }
  203. public com.google.android.apps.mytracks.content.Sensor.SensorData getDefaultInstanceForType() {
  204. return com.google.android.apps.mytracks.content.Sensor.SensorData.getDefaultInstance();
  205. }
  206. public boolean isInitialized() {
  207. return result.isInitialized();
  208. }
  209. public com.google.android.apps.mytracks.content.Sensor.SensorData build() {
  210. if (result != null && !isInitialized()) {
  211. throw newUninitializedMessageException(result);
  212. }
  213. return buildPartial();
  214. }
  215. private com.google.android.apps.mytracks.content.Sensor.SensorData buildParsed()
  216. throws com.google.protobuf.InvalidProtocolBufferException {
  217. if (!isInitialized()) {
  218. throw newUninitializedMessageException(
  219. result).asInvalidProtocolBufferException();
  220. }
  221. return buildPartial();
  222. }
  223. public com.google.android.apps.mytracks.content.Sensor.SensorData buildPartial() {
  224. if (result == null) {
  225. throw new IllegalStateException(
  226. "build() has already been called on this Builder.");
  227. }
  228. com.google.android.apps.mytracks.content.Sensor.SensorData returnMe = result;
  229. result = null;
  230. return returnMe;
  231. }
  232. public Builder mergeFrom(com.google.android.apps.mytracks.content.Sensor.SensorData other) {
  233. if (other == com.google.android.apps.mytracks.content.Sensor.SensorData.getDefaultInstance()) return this;
  234. if (other.hasState()) {
  235. setState(other.getState());
  236. }
  237. if (other.hasValue()) {
  238. setValue(other.getValue());
  239. }
  240. return this;
  241. }
  242. public Builder mergeFrom(
  243. com.google.protobuf.CodedInputStream input,
  244. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  245. throws java.io.IOException {
  246. while (true) {
  247. int tag = input.readTag();
  248. switch (tag) {
  249. case 0:
  250. return this;
  251. default: {
  252. if (!parseUnknownField(input, extensionRegistry, tag)) {
  253. return this;
  254. }
  255. break;
  256. }
  257. case 8: {
  258. int rawValue = input.readEnum();
  259. com.google.android.apps.mytracks.content.Sensor.SensorState value = com.google.android.apps.mytracks.content.Sensor.SensorState.valueOf(rawValue);
  260. if (value != null) {
  261. setState(value);
  262. }
  263. break;
  264. }
  265. case 16: {
  266. setValue(input.readInt32());
  267. break;
  268. }
  269. }
  270. }
  271. }
  272. // required .com.google.android.apps.mytracks.content.SensorState state = 1 [default = NONE];
  273. public boolean hasState() {
  274. return result.hasState();
  275. }
  276. public com.google.android.apps.mytracks.content.Sensor.SensorState getState() {
  277. return result.getState();
  278. }
  279. public Builder setState(com.google.android.apps.mytracks.content.Sensor.SensorState value) {
  280. if (value == null) {
  281. throw new NullPointerException();
  282. }
  283. result.hasState = true;
  284. result.state_ = value;
  285. return this;
  286. }
  287. public Builder clearState() {
  288. result.hasState = false;
  289. result.state_ = com.google.android.apps.mytracks.content.Sensor.SensorState.NONE;
  290. return this;
  291. }
  292. // optional int32 value = 2;
  293. public boolean hasValue() {
  294. return result.hasValue();
  295. }
  296. public int getValue() {
  297. return result.getValue();
  298. }
  299. public Builder setValue(int value) {
  300. result.hasValue = true;
  301. result.value_ = value;
  302. return this;
  303. }
  304. public Builder clearValue() {
  305. result.hasValue = false;
  306. result.value_ = 0;
  307. return this;
  308. }
  309. // @@protoc_insertion_point(builder_scope:com.google.android.apps.mytracks.content.SensorData)
  310. }
  311. static {
  312. defaultInstance = new SensorData(true);
  313. com.google.android.apps.mytracks.content.Sensor.internalForceInit();
  314. defaultInstance.initFields();
  315. }
  316. // @@protoc_insertion_point(class_scope:com.google.android.apps.mytracks.content.SensorData)
  317. }
  318. public static final class SensorDataSet extends
  319. com.google.protobuf.GeneratedMessageLite {
  320. // Use SensorDataSet.newBuilder() to construct.
  321. private SensorDataSet() {
  322. initFields();
  323. }
  324. private SensorDataSet(boolean noInit) {}
  325. private static final SensorDataSet defaultInstance;
  326. public static SensorDataSet getDefaultInstance() {
  327. return defaultInstance;
  328. }
  329. public SensorDataSet getDefaultInstanceForType() {
  330. return defaultInstance;
  331. }
  332. // optional uint64 creation_time = 1 [default = 0];
  333. public static final int CREATION_TIME_FIELD_NUMBER = 1;
  334. private boolean hasCreationTime;
  335. private long creationTime_ = 0L;
  336. public boolean hasCreationTime() { return hasCreationTime; }
  337. public long getCreationTime() { return creationTime_; }
  338. // optional .com.google.android.apps.mytracks.content.SensorData heart_rate = 2;
  339. public static final int HEART_RATE_FIELD_NUMBER = 2;
  340. private boolean hasHeartRate;
  341. private com.google.android.apps.mytracks.content.Sensor.SensorData heartRate_;
  342. public boolean hasHeartRate() { return hasHeartRate; }
  343. public com.google.android.apps.mytracks.content.Sensor.SensorData getHeartRate() { return heartRate_; }
  344. // optional .com.google.android.apps.mytracks.content.SensorData cadence = 3;
  345. public static final int CADENCE_FIELD_NUMBER = 3;
  346. private boolean hasCadence;
  347. private com.google.android.apps.mytracks.content.Sensor.SensorData cadence_;
  348. public boolean hasCadence() { return hasCadence; }
  349. public com.google.android.apps.mytracks.content.Sensor.SensorData getCadence() { return cadence_; }
  350. // optional .com.google.android.apps.mytracks.content.SensorData power = 4;
  351. public static final int POWER_FIELD_NUMBER = 4;
  352. private boolean hasPower;
  353. private com.google.android.apps.mytracks.content.Sensor.SensorData power_;
  354. public boolean hasPower() { return hasPower; }
  355. public com.google.android.apps.mytracks.content.Sensor.SensorData getPower() { return power_; }
  356. // optional .com.google.android.apps.mytracks.content.SensorData battery_level = 5;
  357. public static final int BATTERY_LEVEL_FIELD_NUMBER = 5;
  358. private boolean hasBatteryLevel;
  359. private com.google.android.apps.mytracks.content.Sensor.SensorData batteryLevel_;
  360. public boolean hasBatteryLevel() { return hasBatteryLevel; }
  361. public com.google.android.apps.mytracks.content.Sensor.SensorData getBatteryLevel() { return batteryLevel_; }
  362. private void initFields() {
  363. heartRate_ = com.google.android.apps.mytracks.content.Sensor.SensorData.getDefaultInstance();
  364. cadence_ = com.google.android.apps.mytracks.content.Sensor.SensorData.getDefaultInstance();
  365. power_ = com.google.android.apps.mytracks.content.Sensor.SensorData.getDefaultInstance();
  366. batteryLevel_ = com.google.android.apps.mytracks.content.Sensor.SensorData.getDefaultInstance();
  367. }
  368. public final boolean isInitialized() {
  369. if (hasHeartRate()) {
  370. if (!getHeartRate().isInitialized()) return false;
  371. }
  372. if (hasCadence()) {
  373. if (!getCadence().isInitialized()) return false;
  374. }
  375. if (hasPower()) {
  376. if (!getPower().isInitialized()) return false;
  377. }
  378. if (hasBatteryLevel()) {
  379. if (!getBatteryLevel().isInitialized()) return false;
  380. }
  381. return true;
  382. }
  383. public void writeTo(com.google.protobuf.CodedOutputStream output)
  384. throws java.io.IOException {
  385. getSerializedSize();
  386. if (hasCreationTime()) {
  387. output.writeUInt64(1, getCreationTime());
  388. }
  389. if (hasHeartRate()) {
  390. output.writeMessage(2, getHeartRate());
  391. }
  392. if (hasCadence()) {
  393. output.writeMessage(3, getCadence());
  394. }
  395. if (hasPower()) {
  396. output.writeMessage(4, getPower());
  397. }
  398. if (hasBatteryLevel()) {
  399. output.writeMessage(5, getBatteryLevel());
  400. }
  401. }
  402. private int memoizedSerializedSize = -1;
  403. public int getSerializedSize() {
  404. int size = memoizedSerializedSize;
  405. if (size != -1) return size;
  406. size = 0;
  407. if (hasCreationTime()) {
  408. size += com.google.protobuf.CodedOutputStream
  409. .computeUInt64Size(1, getCreationTime());
  410. }
  411. if (hasHeartRate()) {
  412. size += com.google.protobuf.CodedOutputStream
  413. .computeMessageSize(2, getHeartRate());
  414. }
  415. if (hasCadence()) {
  416. size += com.google.protobuf.CodedOutputStream
  417. .computeMessageSize(3, getCadence());
  418. }
  419. if (hasPower()) {
  420. size += com.google.protobuf.CodedOutputStream
  421. .computeMessageSize(4, getPower());
  422. }
  423. if (hasBatteryLevel()) {
  424. size += com.google.protobuf.CodedOutputStream
  425. .computeMessageSize(5, getBatteryLevel());
  426. }
  427. memoizedSerializedSize = size;
  428. return size;
  429. }
  430. public static com.google.android.apps.mytracks.content.Sensor.SensorDataSet parseFrom(
  431. com.google.protobuf.ByteString data)
  432. throws com.google.protobuf.InvalidProtocolBufferException {
  433. return newBuilder().mergeFrom(data).buildParsed();
  434. }
  435. public static com.google.android.apps.mytracks.content.Sensor.SensorDataSet parseFrom(
  436. com.google.protobuf.ByteString data,
  437. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  438. throws com.google.protobuf.InvalidProtocolBufferException {
  439. return newBuilder().mergeFrom(data, extensionRegistry)
  440. .buildParsed();
  441. }
  442. public static com.google.android.apps.mytracks.content.Sensor.SensorDataSet parseFrom(byte[] data)
  443. throws com.google.protobuf.InvalidProtocolBufferException {
  444. return newBuilder().mergeFrom(data).buildParsed();
  445. }
  446. public static com.google.android.apps.mytracks.content.Sensor.SensorDataSet parseFrom(
  447. byte[] data,
  448. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  449. throws com.google.protobuf.InvalidProtocolBufferException {
  450. return newBuilder().mergeFrom(data, extensionRegistry)
  451. .buildParsed();
  452. }
  453. public static com.google.android.apps.mytracks.content.Sensor.SensorDataSet parseFrom(java.io.InputStream input)
  454. throws java.io.IOException {
  455. return newBuilder().mergeFrom(input).buildParsed();
  456. }
  457. public static com.google.android.apps.mytracks.content.Sensor.SensorDataSet parseFrom(
  458. java.io.InputStream input,
  459. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  460. throws java.io.IOException {
  461. return newBuilder().mergeFrom(input, extensionRegistry)
  462. .buildParsed();
  463. }
  464. public static com.google.android.apps.mytracks.content.Sensor.SensorDataSet parseDelimitedFrom(java.io.InputStream input)
  465. throws java.io.IOException {
  466. Builder builder = newBuilder();
  467. if (builder.mergeDelimitedFrom(input)) {
  468. return builder.buildParsed();
  469. } else {
  470. return null;
  471. }
  472. }
  473. public static com.google.android.apps.mytracks.content.Sensor.SensorDataSet parseDelimitedFrom(
  474. java.io.InputStream input,
  475. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  476. throws java.io.IOException {
  477. Builder builder = newBuilder();
  478. if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
  479. return builder.buildParsed();
  480. } else {
  481. return null;
  482. }
  483. }
  484. public static com.google.android.apps.mytracks.content.Sensor.SensorDataSet parseFrom(
  485. com.google.protobuf.CodedInputStream input)
  486. throws java.io.IOException {
  487. return newBuilder().mergeFrom(input).buildParsed();
  488. }
  489. public static com.google.android.apps.mytracks.content.Sensor.SensorDataSet parseFrom(
  490. com.google.protobuf.CodedInputStream input,
  491. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  492. throws java.io.IOException {
  493. return newBuilder().mergeFrom(input, extensionRegistry)
  494. .buildParsed();
  495. }
  496. public static Builder newBuilder() { return Builder.create(); }
  497. public Builder newBuilderForType() { return newBuilder(); }
  498. public static Builder newBuilder(com.google.android.apps.mytracks.content.Sensor.SensorDataSet prototype) {
  499. return newBuilder().mergeFrom(prototype);
  500. }
  501. public Builder toBuilder() { return newBuilder(this); }
  502. public static final class Builder extends
  503. com.google.protobuf.GeneratedMessageLite.Builder<
  504. com.google.android.apps.mytracks.content.Sensor.SensorDataSet, Builder> {
  505. private com.google.android.apps.mytracks.content.Sensor.SensorDataSet result;
  506. // Construct using com.google.android.apps.mytracks.content.Sensor.SensorDataSet.newBuilder()
  507. private Builder() {}
  508. private static Builder create() {
  509. Builder builder = new Builder();
  510. builder.result = new com.google.android.apps.mytracks.content.Sensor.SensorDataSet();
  511. return builder;
  512. }
  513. protected com.google.android.apps.mytracks.content.Sensor.SensorDataSet internalGetResult() {
  514. return result;
  515. }
  516. public Builder clear() {
  517. if (result == null) {
  518. throw new IllegalStateException(
  519. "Cannot call clear() after build().");
  520. }
  521. result = new com.google.android.apps.mytracks.content.Sensor.SensorDataSet();
  522. return this;
  523. }
  524. public Builder clone() {
  525. return create().mergeFrom(result);
  526. }
  527. public com.google.android.apps.mytracks.content.Sensor.SensorDataSet getDefaultInstanceForType() {
  528. return com.google.android.apps.mytracks.content.Sensor.SensorDataSet.getDefaultInstance();
  529. }
  530. public boolean isInitialized() {
  531. return result.isInitialized();
  532. }
  533. public com.google.android.apps.mytracks.content.Sensor.SensorDataSet build() {
  534. if (result != null && !isInitialized()) {
  535. throw newUninitializedMessageException(result);
  536. }
  537. return buildPartial();
  538. }
  539. private com.google.android.apps.mytracks.content.Sensor.SensorDataSet buildParsed()
  540. throws com.google.protobuf.InvalidProtocolBufferException {
  541. if (!isInitialized()) {
  542. throw newUninitializedMessageException(
  543. result).asInvalidProtocolBufferException();
  544. }
  545. return buildPartial();
  546. }
  547. public com.google.android.apps.mytracks.content.Sensor.SensorDataSet buildPartial() {
  548. if (result == null) {
  549. throw new IllegalStateException(
  550. "build() has already been called on this Builder.");
  551. }
  552. com.google.android.apps.mytracks.content.Sensor.SensorDataSet returnMe = result;
  553. result = null;
  554. return returnMe;
  555. }
  556. public Builder mergeFrom(com.google.android.apps.mytracks.content.Sensor.SensorDataSet other) {
  557. if (other == com.google.android.apps.mytracks.content.Sensor.SensorDataSet.getDefaultInstance()) return this;
  558. if (other.hasCreationTime()) {
  559. setCreationTime(other.getCreationTime());
  560. }
  561. if (other.hasHeartRate()) {
  562. mergeHeartRate(other.getHeartRate());
  563. }
  564. if (other.hasCadence()) {
  565. mergeCadence(other.getCadence());
  566. }
  567. if (other.hasPower()) {
  568. mergePower(other.getPower());
  569. }
  570. if (other.hasBatteryLevel()) {
  571. mergeBatteryLevel(other.getBatteryLevel());
  572. }
  573. return this;
  574. }
  575. public Builder mergeFrom(
  576. com.google.protobuf.CodedInputStream input,
  577. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  578. throws java.io.IOException {
  579. while (true) {
  580. int tag = input.readTag();
  581. switch (tag) {
  582. case 0:
  583. return this;
  584. default: {
  585. if (!parseUnknownField(input, extensionRegistry, tag)) {
  586. return this;
  587. }
  588. break;
  589. }
  590. case 8: {
  591. setCreationTime(input.readUInt64());
  592. break;
  593. }
  594. case 18: {
  595. com.google.android.apps.mytracks.content.Sensor.SensorData.Builder subBuilder = com.google.android.apps.mytracks.content.Sensor.SensorData.newBuilder();
  596. if (hasHeartRate()) {
  597. subBuilder.mergeFrom(getHeartRate());
  598. }
  599. input.readMessage(subBuilder, extensionRegistry);
  600. setHeartRate(subBuilder.buildPartial());
  601. break;
  602. }
  603. case 26: {
  604. com.google.android.apps.mytracks.content.Sensor.SensorData.Builder subBuilder = com.google.android.apps.mytracks.content.Sensor.SensorData.newBuilder();
  605. if (hasCadence()) {
  606. subBuilder.mergeFrom(getCadence());
  607. }
  608. input.readMessage(subBuilder, extensionRegistry);
  609. setCadence(subBuilder.buildPartial());
  610. break;
  611. }
  612. case 34: {
  613. com.google.android.apps.mytracks.content.Sensor.SensorData.Builder subBuilder = com.google.android.apps.mytracks.content.Sensor.SensorData.newBuilder();
  614. if (hasPower()) {
  615. subBuilder.mergeFrom(getPower());
  616. }
  617. input.readMessage(subBuilder, extensionRegistry);
  618. setPower(subBuilder.buildPartial());
  619. break;
  620. }
  621. case 42: {
  622. com.google.android.apps.mytracks.content.Sensor.SensorData.Builder subBuilder = com.google.android.apps.mytracks.content.Sensor.SensorData.newBuilder();
  623. if (hasBatteryLevel()) {
  624. subBuilder.mergeFrom(getBatteryLevel());
  625. }
  626. input.readMessage(subBuilder, extensionRegistry);
  627. setBatteryLevel(subBuilder.buildPartial());
  628. break;
  629. }
  630. }
  631. }
  632. }
  633. // optional uint64 creation_time = 1 [default = 0];
  634. public boolean hasCreationTime() {
  635. return result.hasCreationTime();
  636. }
  637. public long getCreationTime() {
  638. return result.getCreationTime();
  639. }
  640. public Builder setCreationTime(long value) {
  641. result.hasCreationTime = true;
  642. result.creationTime_ = value;
  643. return this;
  644. }
  645. public Builder clearCreationTime() {
  646. result.hasCreationTime = false;
  647. result.creationTime_ = 0L;
  648. return this;
  649. }
  650. // optional .com.google.android.apps.mytracks.content.SensorData heart_rate = 2;
  651. public boolean hasHeartRate() {
  652. return result.hasHeartRate();
  653. }
  654. public com.google.android.apps.mytracks.content.Sensor.SensorData getHeartRate() {
  655. return result.getHeartRate();
  656. }
  657. public Builder setHeartRate(com.google.android.apps.mytracks.content.Sensor.SensorData value) {
  658. if (value == null) {
  659. throw new NullPointerException();
  660. }
  661. result.hasHeartRate = true;
  662. result.heartRate_ = value;
  663. return this;
  664. }
  665. public Builder setHeartRate(com.google.android.apps.mytracks.content.Sensor.SensorData.Builder builderForValue) {
  666. result.hasHeartRate = true;
  667. result.heartRate_ = builderForValue.build();
  668. return this;
  669. }
  670. public Builder mergeHeartRate(com.google.android.apps.mytracks.content.Sensor.SensorData value) {
  671. if (result.hasHeartRate() &&
  672. result.heartRate_ != com.google.android.apps.mytracks.content.Sensor.SensorData.getDefaultInstance()) {
  673. result.heartRate_ =
  674. com.google.android.apps.mytracks.content.Sensor.SensorData.newBuilder(result.heartRate_).mergeFrom(value).buildPartial();
  675. } else {
  676. result.heartRate_ = value;
  677. }
  678. result.hasHeartRate = true;
  679. return this;
  680. }
  681. public Builder clearHeartRate() {
  682. result.hasHeartRate = false;
  683. result.heartRate_ = com.google.android.apps.mytracks.content.Sensor.SensorData.getDefaultInstance();
  684. return this;
  685. }
  686. // optional .com.google.android.apps.mytracks.content.SensorData cadence = 3;
  687. public boolean hasCadence() {
  688. return result.hasCadence();
  689. }
  690. public com.google.android.apps.mytracks.content.Sensor.SensorData getCadence() {
  691. return result.getCadence();
  692. }
  693. public Builder setCadence(com.google.android.apps.mytracks.content.Sensor.SensorData value) {
  694. if (value == null) {
  695. throw new NullPointerException();
  696. }
  697. result.hasCadence = true;
  698. result.cadence_ = value;
  699. return this;
  700. }
  701. public Builder setCadence(com.google.android.apps.mytracks.content.Sensor.SensorData.Builder builderForValue) {
  702. result.hasCadence = true;
  703. result.cadence_ = builderForValue.build();
  704. return this;
  705. }
  706. public Builder mergeCadence(com.google.android.apps.mytracks.content.Sensor.SensorData value) {
  707. if (result.hasCadence() &&
  708. result.cadence_ != com.google.android.apps.mytracks.content.Sensor.SensorData.getDefaultInstance()) {
  709. result.cadence_ =
  710. com.google.android.apps.mytracks.content.Sensor.SensorData.newBuilder(result.cadence_).mergeFrom(value).buildPartial();
  711. } else {
  712. result.cadence_ = value;
  713. }
  714. result.hasCadence = true;
  715. return this;
  716. }
  717. public Builder clearCadence() {
  718. result.hasCadence = false;
  719. result.cadence_ = com.google.android.apps.mytracks.content.Sensor.SensorData.getDefaultInstance();
  720. return this;
  721. }
  722. // optional .com.google.android.apps.mytracks.content.SensorData power = 4;
  723. public boolean hasPower() {
  724. return result.hasPower();
  725. }
  726. public com.google.android.apps.mytracks.content.Sensor.SensorData getPower() {
  727. return result.getPower();
  728. }
  729. public Builder setPower(com.google.android.apps.mytracks.content.Sensor.SensorData value) {
  730. if (value == null) {
  731. throw new NullPointerException();
  732. }
  733. result.hasPower = true;
  734. result.power_ = value;
  735. return this;
  736. }
  737. public Builder setPower(com.google.android.apps.mytracks.content.Sensor.SensorData.Builder builderForValue) {
  738. result.hasPower = true;
  739. result.power_ = builderForValue.build();
  740. return this;
  741. }
  742. public Builder mergePower(com.google.android.apps.mytracks.content.Sensor.SensorData value) {
  743. if (result.hasPower() &&
  744. result.power_ != com.google.android.apps.mytracks.content.Sensor.SensorData.getDefaultInstance()) {
  745. result.power_ =
  746. com.google.android.apps.mytracks.content.Sensor.SensorData.newBuilder(result.power_).mergeFrom(value).buildPartial();
  747. } else {
  748. result.power_ = value;
  749. }
  750. result.hasPower = true;
  751. return this;
  752. }
  753. public Builder clearPower() {
  754. result.hasPower = false;
  755. result.power_ = com.google.android.apps.mytracks.content.Sensor.SensorData.getDefaultInstance();
  756. return this;
  757. }
  758. // optional .com.google.android.apps.mytracks.content.SensorData battery_level = 5;
  759. public boolean hasBatteryLevel() {
  760. return result.hasBatteryLevel();
  761. }
  762. public com.google.android.apps.mytracks.content.Sensor.SensorData getBatteryLevel() {
  763. return result.getBatteryLevel();
  764. }
  765. public Builder setBatteryLevel(com.google.android.apps.mytracks.content.Sensor.SensorData value) {
  766. if (value == null) {
  767. throw new NullPointerException();
  768. }
  769. result.hasBatteryLevel = true;
  770. result.batteryLevel_ = value;
  771. return this;
  772. }
  773. public Builder setBatteryLevel(com.google.android.apps.mytracks.content.Sensor.SensorData.Builder builderForValue) {
  774. result.hasBatteryLevel = true;
  775. result.batteryLevel_ = builderForValue.build();
  776. return this;
  777. }
  778. public Builder mergeBatteryLevel(com.google.android.apps.mytracks.content.Sensor.SensorData value) {
  779. if (result.hasBatteryLevel() &&
  780. result.batteryLevel_ != com.google.android.apps.mytracks.content.Sensor.SensorData.getDefaultInstance()) {
  781. result.batteryLevel_ =
  782. com.google.android.apps.mytracks.content.Sensor.SensorData.newBuilder(result.batteryLevel_).mergeFrom(value).buildPartial();
  783. } else {
  784. result.batteryLevel_ = value;
  785. }
  786. result.hasBatteryLevel = true;
  787. return this;
  788. }
  789. public Builder clearBatteryLevel() {
  790. result.hasBatteryLevel = false;
  791. result.batteryLevel_ = com.google.android.apps.mytracks.content.Sensor.SensorData.getDefaultInstance();
  792. return this;
  793. }
  794. // @@protoc_insertion_point(builder_scope:com.google.android.apps.mytracks.content.SensorDataSet)
  795. }
  796. static {
  797. defaultInstance = new SensorDataSet(true);
  798. com.google.android.apps.mytracks.content.Sensor.internalForceInit();
  799. defaultInstance.initFields();
  800. }
  801. // @@protoc_insertion_point(class_scope:com.google.android.apps.mytracks.content.SensorDataSet)
  802. }
  803. static {
  804. }
  805. public static void internalForceInit() {}
  806. // @@protoc_insertion_point(outer_class_scope)
  807. }