forked from highlight/highlight
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ensure the highlight SDK is compatible with java 11 (highlight#7051)
## Summary Ensure the Java SDK is comparible with Java 11 per customer request. ## How did you test this change? CI testing ## Are there any deployment considerations? Will be tagging and releasing a new SDK version. ## Does this work require review from our design team? No
- Loading branch information
Showing
8 changed files
with
729 additions
and
534 deletions.
There are no files selected for viewing
55 changes: 46 additions & 9 deletions
55
...ighlight-java/highlight-common/src/main/java/io/highlight/sdk/common/HighlightHeader.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,51 @@ | ||
package io.highlight.sdk.common; | ||
|
||
public record HighlightHeader(String sessionId, String requestId) { | ||
public final class HighlightHeader { | ||
|
||
public static final String X_HIGHLIGHT_REQUEST = "x-highlight-request"; | ||
public static final String X_HIGHLIGHT_REQUEST = "x-highlight-request"; | ||
private final String sessionId; | ||
private final String requestId; | ||
|
||
public HighlightHeader(String sessionId, String requestId) { | ||
this.sessionId = sessionId; | ||
this.requestId = requestId; | ||
} | ||
|
||
public static HighlightHeader parse(String header) { | ||
String[] split = header.split("/"); | ||
if (split.length == 2) { | ||
return new HighlightHeader(split[0], split[1]); | ||
} | ||
return null; | ||
} | ||
|
||
public String sessionId() { | ||
return sessionId; | ||
} | ||
|
||
public String requestId() { | ||
return requestId; | ||
} | ||
|
||
@java.lang.Override | ||
public boolean equals(java.lang.Object obj) { | ||
if (obj == this) return true; | ||
if (obj == null || obj.getClass() != this.getClass()) return false; | ||
var that = (HighlightHeader) obj; | ||
return java.util.Objects.equals(this.sessionId, that.sessionId) && | ||
java.util.Objects.equals(this.requestId, that.requestId); | ||
} | ||
|
||
@java.lang.Override | ||
public int hashCode() { | ||
return java.util.Objects.hash(sessionId, requestId); | ||
} | ||
|
||
@java.lang.Override | ||
public String toString() { | ||
return "HighlightHeader[" + | ||
"sessionId=" + sessionId + ", " + | ||
"requestId=" + requestId + ']'; | ||
} | ||
|
||
public static HighlightHeader parse(String header) { | ||
String[] split = header.split("/"); | ||
if (split.length == 2) { | ||
return new HighlightHeader(split[0], split[1]); | ||
} | ||
return null; | ||
} | ||
} |
Oops, something went wrong.