Module jdk.jfr
Package jdk.jfr

Class SettingDescriptor



  • public final class SettingDescriptor
    extends Object
    Describes an event setting
    Since:
    9
    • Method Detail

      • getName

        public String getName​()
        Returns the name of the setting, for example "threshold".
        Returns:
        the name, not null
      • getLabel

        public String getLabel​()
        Returns a human-readable name describing the setting, for example "Threshold".

        If the setting lacks a label, the label for the type associated with this setting is returned, or null if not available.

        Returns:
        a human-readable name, or null if not available
      • getDescription

        public String getDescription​()
        Returns a sentence describing the setting, for example "Record event with duration above or equal to threshold"".

        If the setting lacks a description, the description for the type associated with this setting is returned, or null if not available.

        Returns:
        the description, or null if not available
      • getContentType

        public String getContentType​()
        Returns a textual identifier that determines how a value represented by this SettingDescriptor should be interpreted or formatted.

        For example, if the setting descriptor's represents a percentage the "jdk.jfr.Percentage" hints to a client that a value of "0.5" should be formatted as "50 %".

        The JDK comes with the following predefined content types,

        • jdk.jfr.Percentage
        • jdk.jfr.Timespan
        • jdk.jfr.Timestamp
        • jdk.jfr.Frequency
        • jdk.jfr.Flag
        • jdk.jfr.MemoryAddress
        • jdk.jfr.MemoryAmount
        • jdk.jfr.NetworkAddress

        User defined content types can be created using ContentType. *

        If the setting lacks a content type, the content type for the type associated with this setting is returned, or null if not available.

        Returns:
        the content type, or null if not available
        See Also:
        ContentType
      • getTypeName

        public String getTypeName​()
        Returns the fully qualified class name of the type associated with this setting descriptor.
        Returns:
        the type name, not null
        See Also:
        getTypeId()
      • getTypeId

        public long getTypeId​()
        Returns a unique identifier for the type in the JVM. The id is not guaranteed to be the same between JVM instances.
        Returns:
        type id, not negative
      • getAnnotation

        public <A extends Annotation> A getAnnotation​(Class<A> annotationType)
        Returns the first annotation for the specified type if an annotation element with the same name is available, else null.
        Type Parameters:
        A - the type of the annotation to query for and return if available
        Parameters:
        annotationType - the Class object corresponding to the annotation type, not null
        Returns:
        this element's annotation for the specified annotation type if available, else null
      • getAnnotationElements

        public List<AnnotationElement> getAnnotationElements​()
        Returns an immutable list of annotation elements for this value descriptor.
        Returns:
        a list of annotations, not null
      • getDefaultValue

        public String getDefaultValue​()
        Returns the default value for this setting descriptor.
        Returns:
        the default value, not null