File tree Expand file tree Collapse file tree
main/java/com/stackify/api
test/java/com/stackify/api Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515 */
1616package com .stackify .api ;
1717
18+ import java .util .UUID ;
19+
1820import com .fasterxml .jackson .annotation .JsonIgnoreProperties ;
1921import com .fasterxml .jackson .annotation .JsonInclude ;
2022import com .fasterxml .jackson .annotation .JsonProperty ;
@@ -82,6 +84,12 @@ public class LogMsg {
8284 @ JsonProperty ("SrcLine" )
8385 private final Integer srcLine ;
8486
87+ /**
88+ * The log message id
89+ */
90+ @ JsonProperty ("id" )
91+ private final String id ;
92+
8593 /**
8694 * @return the msg
8795 */
@@ -145,6 +153,13 @@ public Integer getSrcLine() {
145153 return srcLine ;
146154 }
147155
156+ /**
157+ * @return the id
158+ */
159+ public String getId () {
160+ return id ;
161+ }
162+
148163 /**
149164 * @return An instance of Builder, based on current class state
150165 */
@@ -174,6 +189,7 @@ private LogMsg(final Builder builder) {
174189 this .transId = builder .transId ;
175190 this .srcMethod = builder .srcMethod ;
176191 this .srcLine = builder .srcLine ;
192+ this .id = UUID .randomUUID ().toString ();
177193 }
178194
179195 /**
Original file line number Diff line number Diff line change @@ -65,6 +65,8 @@ public void testBuilder() {
6565 Assert .assertEquals (srcMethod , logMsg .getSrcMethod ());
6666 Assert .assertEquals (srcLine , logMsg .getSrcLine ());
6767
68+ Assert .assertNotNull (logMsg .getId ());
69+
6870 LogMsg logMsgCopy = logMsg .toBuilder ().build ();
6971
7072 Assert .assertNotNull (logMsgCopy );
You can’t perform that action at this time.
0 commit comments