Skip to content

Commit

Permalink
ensure the highlight SDK is compatible with java 11 (highlight#7051)
Browse files Browse the repository at this point in the history
## 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
Vadman97 authored Nov 2, 2023
1 parent 7355c73 commit ee35f40
Show file tree
Hide file tree
Showing 8 changed files with 729 additions and 534 deletions.
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;
}
}
Loading

0 comments on commit ee35f40

Please sign in to comment.