public final class EventType
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
<A extends java.lang.annotation.Annotation> |
getAnnotation(java.lang.Class<A> annotationClass)
Returns the first annotation for the specified type if an annotation
element with the same name is directly present, otherwise
null. |
java.util.List<AnnotationElement> |
getAnnotationElements()
Returns an immutable list of annotation elements for this event type.
|
java.util.List<java.lang.String> |
getCategoryNames()
Returns the list of human-readable names that makes up the categories for
this event type (for example,
"Java Application", "Statistics"). |
java.lang.String |
getDescription()
Returns a short sentence that describes the event class.
|
static EventType |
getEventType(java.lang.Class<? extends Event> eventClass)
Returns the event type for an event class, or
null if it doesn't
exist. |
ValueDescriptor |
getField(java.lang.String name)
Returns the field with the specified name, or
null if it doesn't
exist. |
java.util.List<ValueDescriptor> |
getFields()
Returns an immutable list of descriptors that describe the event fields of
this event type.
|
long |
getId()
Returns a unique ID for this event type in the Java Virtual Machine (JVM).
|
java.lang.String |
getLabel()
Returns a human-readable name (for example,
"CPU Load"). |
java.lang.String |
getName()
Returns an identifier for the event (for example,
"jdk.CPULoad"). |
java.util.List<SettingDescriptor> |
getSettingDescriptors()
Returns an immutable list of the setting descriptors that describe the available
event settings for this event type.
|
boolean |
isEnabled()
Returns
true if the event is enabled and at least one recording is
running, false otherwise. |
public java.util.List<ValueDescriptor> getFields()
nullpublic ValueDescriptor getField(java.lang.String name)
null if it doesn't
exist.null if
the field with the specified name doesn't existpublic java.lang.String getName()
"jdk.CPULoad").
The identifier is the fully qualified name of the event class, if not set using
the Name annotation.
nullNamepublic java.lang.String getLabel()
"CPU Load").
The label of an event class can be set with Label.
null if a label is not setLabelpublic long getId()
public java.util.List<AnnotationElement> getAnnotationElements()
nullpublic boolean isEnabled()
true if the event is enabled and at least one recording is
running, false otherwise.
By default, the event is enabled. The event can be enabled or disabled by
setting the enabled setting to true or false, programmatically or by using a
configuration file. The event can also be disabled by annotating event with
the @Enabled(false) annotation.
Enabled,
Recording.enable(Class)public java.lang.String getDescription()
The description of an event class can be set with Description.
null if no description existsDescriptionpublic <A extends java.lang.annotation.Annotation> A getAnnotation(java.lang.Class<A> annotationClass)
null.A - the type of the annotation to query for and return if presentannotationClass - the Class object that corresponds to the
annotation type, not nullnullpublic static EventType getEventType(java.lang.Class<? extends Event> eventClass)
null if it doesn't
exist.eventClass - the event class, not nulljava.lang.IllegalArgumentException - if eventClass is an abstract classjava.lang.IllegalStateException - if the class is annotated with
Registered(false), but not manually registeredpublic java.util.List<SettingDescriptor> getSettingDescriptors()
nullpublic java.util.List<java.lang.String> getCategoryNames()
"Java Application", "Statistics")."Uncategorized" if no category is setCategory