You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Measure.java 4.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. /*
  2. * SonarQube
  3. * Copyright (C) 2009-2023 SonarSource SA
  4. * mailto:info AT sonarsource DOT com
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 3 of the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public License
  17. * along with this program; if not, write to the Free Software Foundation,
  18. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  19. */
  20. package org.sonarqube.monitoring.test;
  21. public class Measure {
  22. private String timestamp;
  23. private String branchName;
  24. private String commit;
  25. private String build;
  26. private String category;
  27. private String testClass;
  28. private String testMethod;
  29. private String exceptionClass;
  30. private String exceptionMessage;
  31. private String exceptionLogs;
  32. private Measure() {
  33. }
  34. public String getTimestamp() {
  35. return timestamp;
  36. }
  37. public void setTimestamp(String timestamp) {
  38. this.timestamp = timestamp;
  39. }
  40. public String getBranchName() {
  41. return branchName;
  42. }
  43. public void setBranchName(String branchName) {
  44. this.branchName = branchName;
  45. }
  46. public String getCommit() {
  47. return commit;
  48. }
  49. public void setCommit(String commit) {
  50. this.commit = commit;
  51. }
  52. public String getBuild() {
  53. return build;
  54. }
  55. public void setBuild(String build) {
  56. this.build = build;
  57. }
  58. public String getCategory() {
  59. return category;
  60. }
  61. public void setCategory(String category) {
  62. this.category = category;
  63. }
  64. public String getTestClass() {
  65. return testClass;
  66. }
  67. public void setTestClass(String testClass) {
  68. this.testClass = testClass;
  69. }
  70. public String getTestMethod() {
  71. return testMethod;
  72. }
  73. public void setTestMethod(String testMethod) {
  74. this.testMethod = testMethod;
  75. }
  76. public String getExceptionClass() {
  77. return exceptionClass;
  78. }
  79. public void setExceptionClass(String exceptionClass) {
  80. this.exceptionClass = exceptionClass;
  81. }
  82. public String getExceptionMessage() {
  83. return exceptionMessage;
  84. }
  85. public void setExceptionMessage(String exceptionMessage) {
  86. this.exceptionMessage = exceptionMessage;
  87. }
  88. public String getExceptionLogs() {
  89. return exceptionLogs;
  90. }
  91. public void setExceptionLogs(String exceptionLogs) {
  92. this.exceptionLogs = exceptionLogs;
  93. }
  94. @Override
  95. public String toString() {
  96. return "Measure{" +
  97. "timestamp='" + timestamp + '\'' +
  98. ", branchName='" + branchName + '\'' +
  99. ", commit='" + commit + '\'' +
  100. ", build='" + build + '\'' +
  101. ", category='" + category + '\'' +
  102. ", testClass='" + testClass + '\'' +
  103. ", testMethod='" + testMethod + '\'' +
  104. ", exceptionClass='" + exceptionClass + '\'' +
  105. ", exceptionMessage='" + exceptionMessage + '\'' +
  106. ", exceptionLogs='" + exceptionLogs + '\'' +
  107. '}';
  108. }
  109. public static final class MeasureBuilder {
  110. private Measure measure;
  111. private MeasureBuilder() {
  112. measure = new Measure();
  113. }
  114. public static MeasureBuilder newMeasureBuilder() {
  115. return new MeasureBuilder();
  116. }
  117. public MeasureBuilder setTimestamp(String timestamp) {
  118. measure.setTimestamp(timestamp);
  119. return this;
  120. }
  121. public MeasureBuilder setBranchName(String branchName) {
  122. measure.setBranchName(branchName);
  123. return this;
  124. }
  125. public MeasureBuilder setCommit(String commit) {
  126. measure.setCommit(commit);
  127. return this;
  128. }
  129. public MeasureBuilder setBuild(String build) {
  130. measure.setBuild(build);
  131. return this;
  132. }
  133. public MeasureBuilder setCategory(String category) {
  134. measure.setCategory(category);
  135. return this;
  136. }
  137. public MeasureBuilder setTestClass(String testClass) {
  138. measure.setTestClass(testClass);
  139. return this;
  140. }
  141. public MeasureBuilder setTestMethod(String testMethod) {
  142. measure.setTestMethod(testMethod);
  143. return this;
  144. }
  145. public MeasureBuilder setExceptionClass(String exceptionClass) {
  146. measure.setExceptionClass(exceptionClass);
  147. return this;
  148. }
  149. public MeasureBuilder setExceptionMessage(String exceptionMessage) {
  150. measure.setExceptionMessage(exceptionMessage);
  151. return this;
  152. }
  153. public MeasureBuilder setExceptionLogs(String exceptionLogs) {
  154. measure.setExceptionLogs(exceptionLogs);
  155. return this;
  156. }
  157. public Measure build() {
  158. return measure;
  159. }
  160. }
  161. }