When creating trace event format events, the code used to throw NullPointerExceptions when trying to construct an event from a JsonObject that was missing required members.
This change adds static fromJson methods, which check the members exist, or otherwise throw an IllegalArgumentException. This better communicates the kind of error that occurred - the provided Json did not have the expected form.
This change also adds some basic documentation and tests for the Event classes.
When creating trace event format events, the code used to throw NullPointerExceptions when trying to construct an event from a JsonObject that was missing required members.
This change adds static
fromJson
methods, which check the members exist, or otherwise throw an IllegalArgumentException. This better communicates the kind of error that occurred - the provided Json did not have the expected form. This change also adds some basic documentation and tests for the Event classes.