PageRenderTime 27ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/openbus.model/src/main/java/br/com/produban/openbus/model/avro/SQLServer.java

https://gitlab.com/marcelosabino/OpenbusBR
Java | 413 lines | 274 code | 48 blank | 91 comment | 14 complexity | b6be632ec5b9586bd1d831a616b0bfe1 MD5 | raw file
  1. /**
  2. * Autogenerated by Avro
  3. *
  4. * DO NOT EDIT DIRECTLY
  5. */
  6. package br.com.produban.openbus.model.avro;
  7. @SuppressWarnings("all")
  8. /** MS SQL Server schema. */
  9. @org.apache.avro.specific.AvroGenerated
  10. public class SQLServer extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
  11. public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"SQLServer\",\"namespace\":\"br.com.produban.openbus.model.avro\",\"doc\":\"MS SQL Server schema.\",\"fields\":[{\"name\":\"instanceId\",\"type\":[{\"type\":\"string\",\"avro.java.string\":\"String\"},\"null\"]},{\"name\":\"dbName\",\"type\":[{\"type\":\"string\",\"avro.java.string\":\"String\"},\"null\"]},{\"name\":\"timestamp\",\"type\":[{\"type\":\"string\",\"avro.java.string\":\"String\"},\"null\"]},{\"name\":\"value\",\"type\":[{\"type\":\"string\",\"avro.java.string\":\"String\"},\"null\"]},{\"name\":\"metricUnit\",\"type\":[{\"type\":\"string\",\"avro.java.string\":\"String\"},\"null\"]},{\"name\":\"metricName\",\"type\":[{\"type\":\"string\",\"avro.java.string\":\"String\"},\"null\"]}]}");
  12. public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
  13. @Deprecated public java.lang.String instanceId;
  14. @Deprecated public java.lang.String dbName;
  15. @Deprecated public java.lang.String timestamp;
  16. @Deprecated public java.lang.String value;
  17. @Deprecated public java.lang.String metricUnit;
  18. @Deprecated public java.lang.String metricName;
  19. /**
  20. * Default constructor. Note that this does not initialize fields
  21. * to their default values from the schema. If that is desired then
  22. * one should use <code>newBuilder()</code>.
  23. */
  24. public SQLServer() {}
  25. /**
  26. * All-args constructor.
  27. */
  28. public SQLServer(java.lang.String instanceId, java.lang.String dbName, java.lang.String timestamp, java.lang.String value, java.lang.String metricUnit, java.lang.String metricName) {
  29. this.instanceId = instanceId;
  30. this.dbName = dbName;
  31. this.timestamp = timestamp;
  32. this.value = value;
  33. this.metricUnit = metricUnit;
  34. this.metricName = metricName;
  35. }
  36. public org.apache.avro.Schema getSchema() { return SCHEMA$; }
  37. // Used by DatumWriter. Applications should not call.
  38. public java.lang.Object get(int field$) {
  39. switch (field$) {
  40. case 0: return instanceId;
  41. case 1: return dbName;
  42. case 2: return timestamp;
  43. case 3: return value;
  44. case 4: return metricUnit;
  45. case 5: return metricName;
  46. default: throw new org.apache.avro.AvroRuntimeException("Bad index");
  47. }
  48. }
  49. // Used by DatumReader. Applications should not call.
  50. @SuppressWarnings(value="unchecked")
  51. public void put(int field$, java.lang.Object value$) {
  52. switch (field$) {
  53. case 0: instanceId = (java.lang.String)value$; break;
  54. case 1: dbName = (java.lang.String)value$; break;
  55. case 2: timestamp = (java.lang.String)value$; break;
  56. case 3: value = (java.lang.String)value$; break;
  57. case 4: metricUnit = (java.lang.String)value$; break;
  58. case 5: metricName = (java.lang.String)value$; break;
  59. default: throw new org.apache.avro.AvroRuntimeException("Bad index");
  60. }
  61. }
  62. /**
  63. * Gets the value of the 'instanceId' field.
  64. */
  65. public java.lang.String getInstanceId() {
  66. return instanceId;
  67. }
  68. /**
  69. * Sets the value of the 'instanceId' field.
  70. * @param value the value to set.
  71. */
  72. public void setInstanceId(java.lang.String value) {
  73. this.instanceId = value;
  74. }
  75. /**
  76. * Gets the value of the 'dbName' field.
  77. */
  78. public java.lang.String getDbName() {
  79. return dbName;
  80. }
  81. /**
  82. * Sets the value of the 'dbName' field.
  83. * @param value the value to set.
  84. */
  85. public void setDbName(java.lang.String value) {
  86. this.dbName = value;
  87. }
  88. /**
  89. * Gets the value of the 'timestamp' field.
  90. */
  91. public java.lang.String getTimestamp() {
  92. return timestamp;
  93. }
  94. /**
  95. * Sets the value of the 'timestamp' field.
  96. * @param value the value to set.
  97. */
  98. public void setTimestamp(java.lang.String value) {
  99. this.timestamp = value;
  100. }
  101. /**
  102. * Gets the value of the 'value' field.
  103. */
  104. public java.lang.String getValue() {
  105. return value;
  106. }
  107. /**
  108. * Sets the value of the 'value' field.
  109. * @param value the value to set.
  110. */
  111. public void setValue(java.lang.String value) {
  112. this.value = value;
  113. }
  114. /**
  115. * Gets the value of the 'metricUnit' field.
  116. */
  117. public java.lang.String getMetricUnit() {
  118. return metricUnit;
  119. }
  120. /**
  121. * Sets the value of the 'metricUnit' field.
  122. * @param value the value to set.
  123. */
  124. public void setMetricUnit(java.lang.String value) {
  125. this.metricUnit = value;
  126. }
  127. /**
  128. * Gets the value of the 'metricName' field.
  129. */
  130. public java.lang.String getMetricName() {
  131. return metricName;
  132. }
  133. /**
  134. * Sets the value of the 'metricName' field.
  135. * @param value the value to set.
  136. */
  137. public void setMetricName(java.lang.String value) {
  138. this.metricName = value;
  139. }
  140. /** Creates a new SQLServer RecordBuilder */
  141. public static br.com.produban.openbus.model.avro.SQLServer.Builder newBuilder() {
  142. return new br.com.produban.openbus.model.avro.SQLServer.Builder();
  143. }
  144. /** Creates a new SQLServer RecordBuilder by copying an existing Builder */
  145. public static br.com.produban.openbus.model.avro.SQLServer.Builder newBuilder(br.com.produban.openbus.model.avro.SQLServer.Builder other) {
  146. return new br.com.produban.openbus.model.avro.SQLServer.Builder(other);
  147. }
  148. /** Creates a new SQLServer RecordBuilder by copying an existing SQLServer instance */
  149. public static br.com.produban.openbus.model.avro.SQLServer.Builder newBuilder(br.com.produban.openbus.model.avro.SQLServer other) {
  150. return new br.com.produban.openbus.model.avro.SQLServer.Builder(other);
  151. }
  152. /**
  153. * RecordBuilder for SQLServer instances.
  154. */
  155. public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<SQLServer>
  156. implements org.apache.avro.data.RecordBuilder<SQLServer> {
  157. private java.lang.String instanceId;
  158. private java.lang.String dbName;
  159. private java.lang.String timestamp;
  160. private java.lang.String value;
  161. private java.lang.String metricUnit;
  162. private java.lang.String metricName;
  163. /** Creates a new Builder */
  164. private Builder() {
  165. super(br.com.produban.openbus.model.avro.SQLServer.SCHEMA$);
  166. }
  167. /** Creates a Builder by copying an existing Builder */
  168. private Builder(br.com.produban.openbus.model.avro.SQLServer.Builder other) {
  169. super(other);
  170. if (isValidValue(fields()[0], other.instanceId)) {
  171. this.instanceId = data().deepCopy(fields()[0].schema(), other.instanceId);
  172. fieldSetFlags()[0] = true;
  173. }
  174. if (isValidValue(fields()[1], other.dbName)) {
  175. this.dbName = data().deepCopy(fields()[1].schema(), other.dbName);
  176. fieldSetFlags()[1] = true;
  177. }
  178. if (isValidValue(fields()[2], other.timestamp)) {
  179. this.timestamp = data().deepCopy(fields()[2].schema(), other.timestamp);
  180. fieldSetFlags()[2] = true;
  181. }
  182. if (isValidValue(fields()[3], other.value)) {
  183. this.value = data().deepCopy(fields()[3].schema(), other.value);
  184. fieldSetFlags()[3] = true;
  185. }
  186. if (isValidValue(fields()[4], other.metricUnit)) {
  187. this.metricUnit = data().deepCopy(fields()[4].schema(), other.metricUnit);
  188. fieldSetFlags()[4] = true;
  189. }
  190. if (isValidValue(fields()[5], other.metricName)) {
  191. this.metricName = data().deepCopy(fields()[5].schema(), other.metricName);
  192. fieldSetFlags()[5] = true;
  193. }
  194. }
  195. /** Creates a Builder by copying an existing SQLServer instance */
  196. private Builder(br.com.produban.openbus.model.avro.SQLServer other) {
  197. super(br.com.produban.openbus.model.avro.SQLServer.SCHEMA$);
  198. if (isValidValue(fields()[0], other.instanceId)) {
  199. this.instanceId = data().deepCopy(fields()[0].schema(), other.instanceId);
  200. fieldSetFlags()[0] = true;
  201. }
  202. if (isValidValue(fields()[1], other.dbName)) {
  203. this.dbName = data().deepCopy(fields()[1].schema(), other.dbName);
  204. fieldSetFlags()[1] = true;
  205. }
  206. if (isValidValue(fields()[2], other.timestamp)) {
  207. this.timestamp = data().deepCopy(fields()[2].schema(), other.timestamp);
  208. fieldSetFlags()[2] = true;
  209. }
  210. if (isValidValue(fields()[3], other.value)) {
  211. this.value = data().deepCopy(fields()[3].schema(), other.value);
  212. fieldSetFlags()[3] = true;
  213. }
  214. if (isValidValue(fields()[4], other.metricUnit)) {
  215. this.metricUnit = data().deepCopy(fields()[4].schema(), other.metricUnit);
  216. fieldSetFlags()[4] = true;
  217. }
  218. if (isValidValue(fields()[5], other.metricName)) {
  219. this.metricName = data().deepCopy(fields()[5].schema(), other.metricName);
  220. fieldSetFlags()[5] = true;
  221. }
  222. }
  223. /** Gets the value of the 'instanceId' field */
  224. public java.lang.String getInstanceId() {
  225. return instanceId;
  226. }
  227. /** Sets the value of the 'instanceId' field */
  228. public br.com.produban.openbus.model.avro.SQLServer.Builder setInstanceId(java.lang.String value) {
  229. validate(fields()[0], value);
  230. this.instanceId = value;
  231. fieldSetFlags()[0] = true;
  232. return this;
  233. }
  234. /** Checks whether the 'instanceId' field has been set */
  235. public boolean hasInstanceId() {
  236. return fieldSetFlags()[0];
  237. }
  238. /** Clears the value of the 'instanceId' field */
  239. public br.com.produban.openbus.model.avro.SQLServer.Builder clearInstanceId() {
  240. instanceId = null;
  241. fieldSetFlags()[0] = false;
  242. return this;
  243. }
  244. /** Gets the value of the 'dbName' field */
  245. public java.lang.String getDbName() {
  246. return dbName;
  247. }
  248. /** Sets the value of the 'dbName' field */
  249. public br.com.produban.openbus.model.avro.SQLServer.Builder setDbName(java.lang.String value) {
  250. validate(fields()[1], value);
  251. this.dbName = value;
  252. fieldSetFlags()[1] = true;
  253. return this;
  254. }
  255. /** Checks whether the 'dbName' field has been set */
  256. public boolean hasDbName() {
  257. return fieldSetFlags()[1];
  258. }
  259. /** Clears the value of the 'dbName' field */
  260. public br.com.produban.openbus.model.avro.SQLServer.Builder clearDbName() {
  261. dbName = null;
  262. fieldSetFlags()[1] = false;
  263. return this;
  264. }
  265. /** Gets the value of the 'timestamp' field */
  266. public java.lang.String getTimestamp() {
  267. return timestamp;
  268. }
  269. /** Sets the value of the 'timestamp' field */
  270. public br.com.produban.openbus.model.avro.SQLServer.Builder setTimestamp(java.lang.String value) {
  271. validate(fields()[2], value);
  272. this.timestamp = value;
  273. fieldSetFlags()[2] = true;
  274. return this;
  275. }
  276. /** Checks whether the 'timestamp' field has been set */
  277. public boolean hasTimestamp() {
  278. return fieldSetFlags()[2];
  279. }
  280. /** Clears the value of the 'timestamp' field */
  281. public br.com.produban.openbus.model.avro.SQLServer.Builder clearTimestamp() {
  282. timestamp = null;
  283. fieldSetFlags()[2] = false;
  284. return this;
  285. }
  286. /** Gets the value of the 'value' field */
  287. public java.lang.String getValue() {
  288. return value;
  289. }
  290. /** Sets the value of the 'value' field */
  291. public br.com.produban.openbus.model.avro.SQLServer.Builder setValue(java.lang.String value) {
  292. validate(fields()[3], value);
  293. this.value = value;
  294. fieldSetFlags()[3] = true;
  295. return this;
  296. }
  297. /** Checks whether the 'value' field has been set */
  298. public boolean hasValue() {
  299. return fieldSetFlags()[3];
  300. }
  301. /** Clears the value of the 'value' field */
  302. public br.com.produban.openbus.model.avro.SQLServer.Builder clearValue() {
  303. value = null;
  304. fieldSetFlags()[3] = false;
  305. return this;
  306. }
  307. /** Gets the value of the 'metricUnit' field */
  308. public java.lang.String getMetricUnit() {
  309. return metricUnit;
  310. }
  311. /** Sets the value of the 'metricUnit' field */
  312. public br.com.produban.openbus.model.avro.SQLServer.Builder setMetricUnit(java.lang.String value) {
  313. validate(fields()[4], value);
  314. this.metricUnit = value;
  315. fieldSetFlags()[4] = true;
  316. return this;
  317. }
  318. /** Checks whether the 'metricUnit' field has been set */
  319. public boolean hasMetricUnit() {
  320. return fieldSetFlags()[4];
  321. }
  322. /** Clears the value of the 'metricUnit' field */
  323. public br.com.produban.openbus.model.avro.SQLServer.Builder clearMetricUnit() {
  324. metricUnit = null;
  325. fieldSetFlags()[4] = false;
  326. return this;
  327. }
  328. /** Gets the value of the 'metricName' field */
  329. public java.lang.String getMetricName() {
  330. return metricName;
  331. }
  332. /** Sets the value of the 'metricName' field */
  333. public br.com.produban.openbus.model.avro.SQLServer.Builder setMetricName(java.lang.String value) {
  334. validate(fields()[5], value);
  335. this.metricName = value;
  336. fieldSetFlags()[5] = true;
  337. return this;
  338. }
  339. /** Checks whether the 'metricName' field has been set */
  340. public boolean hasMetricName() {
  341. return fieldSetFlags()[5];
  342. }
  343. /** Clears the value of the 'metricName' field */
  344. public br.com.produban.openbus.model.avro.SQLServer.Builder clearMetricName() {
  345. metricName = null;
  346. fieldSetFlags()[5] = false;
  347. return this;
  348. }
  349. @Override
  350. public SQLServer build() {
  351. try {
  352. SQLServer record = new SQLServer();
  353. record.instanceId = fieldSetFlags()[0] ? this.instanceId : (java.lang.String) defaultValue(fields()[0]);
  354. record.dbName = fieldSetFlags()[1] ? this.dbName : (java.lang.String) defaultValue(fields()[1]);
  355. record.timestamp = fieldSetFlags()[2] ? this.timestamp : (java.lang.String) defaultValue(fields()[2]);
  356. record.value = fieldSetFlags()[3] ? this.value : (java.lang.String) defaultValue(fields()[3]);
  357. record.metricUnit = fieldSetFlags()[4] ? this.metricUnit : (java.lang.String) defaultValue(fields()[4]);
  358. record.metricName = fieldSetFlags()[5] ? this.metricName : (java.lang.String) defaultValue(fields()[5]);
  359. return record;
  360. } catch (Exception e) {
  361. throw new org.apache.avro.AvroRuntimeException(e);
  362. }
  363. }
  364. }
  365. }