Skip to content
This repository has been archived by the owner on Jul 26, 2023. It is now read-only.

update jackson bindings #2

Merged
merged 1 commit into from
Jan 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.Date;
import java.util.concurrent.TimeUnit;
Expand All @@ -17,6 +18,8 @@ public class HarEntry {
private volatile HarCache cache = new HarCache();
private volatile HarTimings timings = new HarTimings();
private volatile String serverIPAddress;
@JsonProperty("time")
private volatile long time;
private volatile String connection;
private volatile String comment = "";

Expand Down Expand Up @@ -157,4 +160,10 @@ public String getConnection() {
public void setConnection(String connection) {
this.connection = connection;
}

public HarEntry setTime(long time) {
this.time = time;
return this;
}

}
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
package net.lightbody.bmp.core.har;

import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.concurrent.TimeUnit;

public class HarTimings {
// optional values are initialized to -1, which indicates they do not apply to the current request, according to the HAR spec
@JsonProperty("blocked")
private volatile long blockedNanos = -1;
@JsonProperty("dns")
private volatile long dnsNanos = -1;
@JsonProperty("connect")
private volatile long connectNanos = -1;
@JsonProperty("send")
private volatile long sendNanos;
@JsonProperty("wait")
private volatile long waitNanos;
@JsonProperty("receive")
private volatile long receiveNanos;
@JsonProperty("ssl")
private volatile long sslNanos = -1;
private volatile String comment = "";

Expand Down Expand Up @@ -49,7 +58,7 @@ public long getDns(TimeUnit timeUnit) {
public void setDns(long dns, TimeUnit timeUnit) {
if (dns == -1) {
this.dnsNanos = -1;
} else{
} else {
this.dnsNanos = TimeUnit.NANOSECONDS.convert(dns, timeUnit);
}
}
Expand Down