public final class RequestTimeline extends Object implements Iterable<RequestTimeline.Event>
A RequestTimeline represents a timeline as a sequence of RequestTimeline.Event instances with name, time, and
duration properties. Hence, one might use this class to represent any timeline.
RequestTimeline serializes to JSON as an array of RequestTimeline.Event instances. This is the default
serialization for any class that implements Iterable.
Example:
OffsetDateTime startTime = OffsetDateTime.parse("2020-01-07T11:24:12.842749-08:00", DateTimeFormatter.ISO_OFFSET_DATE_TIME);
sys.out.println(RequestTimeline.of(
new RequestTimeline.Event("foo", startTime, startTime.plusSeconds(1)),
new RequestTimeline.Event("bar", startTime.plusSeconds(1), startTime.plusSeconds(2))));
JSON serialization:
[{"name":"foo","time":"2020-01-07T11:24:12.842749-08:00","duration":"PT1S"},{"name":"bar","time":"2020-01-07T11:24:13.842749-08:00","duration":"PT1S"}])| Modifier and Type | Class and Description |
|---|---|
static class |
RequestTimeline.Event |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic static RequestTimeline empty()
RequestTimeline.
The empty time line returned is static.RequestTimeline.public Iterator<RequestTimeline.Event> iterator()
RequestTimeline.Event instances in this RequestTimeline.iterator in interface Iterable<RequestTimeline.Event>RequestTimeline.Event instances in this RequestTimeline.public static RequestTimeline of()
RequestTimeline.
The empty time line returned is static and equivalent to calling empty().public static RequestTimeline of(RequestTimeline.Event event)
RequestTimeline with a single event.RequestTimeline with a single event.public static RequestTimeline of(RequestTimeline.Event e1, RequestTimeline.Event e2)
RequestTimeline with a pair of events.RequestTimeline with a pair of events.public static RequestTimeline of(RequestTimeline.Event e1, RequestTimeline.Event e2, RequestTimeline.Event e3)
RequestTimeline with three events.RequestTimeline with three events.public static RequestTimeline of(RequestTimeline.Event e1, RequestTimeline.Event e2, RequestTimeline.Event e3, RequestTimeline.Event e4)
RequestTimeline with four events.RequestTimeline with four events.public static RequestTimeline of(RequestTimeline.Event e1, RequestTimeline.Event e2, RequestTimeline.Event e3, RequestTimeline.Event e4, RequestTimeline.Event e5)
RequestTimeline with five events.RequestTimeline with five events.public static RequestTimeline of(RequestTimeline.Event... events)
RequestTimeline with an arbitrary number of events.RequestTimeline with an arbitrary number of events.public String toString()
RequestTimeline.
The textual representation returned is a string of the form RequestTimeline( <event-array>
).
Copyright © 2020. All rights reserved.