src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/ObjectContext.java
branchJEP-349-branch
changeset 58197 0ef79bd7fb5c
parent 58180 0a8943b4d0dd
child 58200 2d147d680311
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/ObjectContext.java	Tue Sep 17 19:37:49 2019 +0200
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/ObjectContext.java	Wed Sep 18 03:45:46 2019 +0200
@@ -24,6 +24,7 @@
  */
 package jdk.jfr.internal.consumer;
 
+import java.time.ZoneId;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -33,12 +34,12 @@
 
 public final class ObjectContext {
     private final Map<ValueDescriptor, ObjectContext> contextLookup;
+    private final TimeConverter timeConverter;
 
     public final EventType eventType;
     public final List<ValueDescriptor> fields;
-    public final TimeConverter timeConverter;
 
-    public ObjectContext(EventType eventType, List<ValueDescriptor> fields, TimeConverter timeConverter) {
+    ObjectContext(EventType eventType, List<ValueDescriptor> fields, TimeConverter timeConverter) {
         this.contextLookup = new HashMap<>();
         this.eventType = eventType;
         this.fields = fields;
@@ -60,4 +61,16 @@
         }
         return context;
     }
-}
+
+    public long convertTimestamp(long ticks) {
+        return timeConverter.convertTimestamp(ticks);
+    }
+
+    public long convertTimespan(long ticks) {
+        return timeConverter.convertTimespan(ticks);
+    }
+
+    public ZoneId getZoneOffset() {
+        return timeConverter.getZoneOffset();
+    }
+}
\ No newline at end of file