APIdia Launch Partner
Top Description Fields Constructors Methods
jdk.jfr

public final Class SettingDescriptor

extends Object
Class Inheritance
Imports
java.lang.annotation.Annotation, java.util.List, .Objects, jdk.jfr.internal.AnnotationConstruct, .Type

Describes an event setting.
Since
9

Field Summary

Modifier and TypeField and Description
private final AnnotationConstruct
private final String
private final String
private final Type

Constructor Summary

AccessConstructor and Description
pack-priv
SettingDescriptor(Type type, String name, String defaultValue, List<AnnotationElement> annotations)

Method Summary

Modifier and TypeMethod and Description
public <
the type of the annotation to query for and return if available
A extends Annotation
>
A

Returns:

this element's annotation for the specified annotation type if available, null otherwise
getAnnotation
(Class<A>
the Class object that corresponds to the annotation type, not null
annotationType
)

Returns the first annotation for the specified type if an annotation element with the same name is available, null otherwise.

public List<AnnotationElement>

Returns:

a list of annotations, not null
getAnnotationElements
()

Returns an immutable list of annotation elements for this value descriptor.

public String

Returns:

the content type, or null if doesn't exist
getContentType
()

Returns a textual identifier that specifies how a value that is represented by this SettingDescriptor object is interpreted or formatted.

public String

Returns:

the default value, not null
getDefaultValue
()

Returns the default value for this setting descriptor.

public String

Returns:

the description, or null if doesn't exist
getDescription
()

Returns a sentence that describes the setting (for example "Record event with duration above or equal to threshold").

public String

Returns:

a human-readable name, or null if doesn't exist
getLabel
()

Returns a human-readable name that describes the setting (for example, "Threshold").

public String

Returns:

the name, not null
getName
()

Returns the name of the setting (for example, "threshold").

pack-priv Type
public long

Returns:

the type ID, not negative
getTypeId
()

Returns a unique ID for the type in the Java Virtual Machine (JVM).

public String

Returns:

the type name, not null
getTypeName
()

Returns the fully qualified class name of the type that is associated with this setting descriptor.

pack-priv void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

annotationConstructback to summary
private final AnnotationConstruct annotationConstruct
defaultValueback to summary
private final String defaultValue
nameback to summary
private final String name
typeback to summary
private final Type type

Constructor Detail

SettingDescriptorback to summary
pack-priv SettingDescriptor(Type type, String name, String defaultValue, List<AnnotationElement> annotations)

Method Detail

getAnnotationback to summary
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, null otherwise.

Parameters
<A>
the type of the annotation to query for and return if available
annotationType:Class<A>

the Class object that corresponds to the annotation type, not null

Returns:A

this element's annotation for the specified annotation type if available, null otherwise

getAnnotationElementsback to summary
public List<AnnotationElement> getAnnotationElements()

Returns an immutable list of annotation elements for this value descriptor.

Returns:List<AnnotationElement>

a list of annotations, not null

getContentTypeback to summary
public String getContentType()

Returns a textual identifier that specifies how a value that is represented by this SettingDescriptor object is interpreted or formatted.

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

The JDK provides 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.DataAmount
  • jdk.jfr.NetworkAddress

User-defined content types can be created by using ContentType.

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

Returns:String

the content type, or null if doesn't exist

See Also
ContentType
getDefaultValueback to summary
public String getDefaultValue()

Returns the default value for this setting descriptor.

Returns:String

the default value, not null

getDescriptionback to summary
public String getDescription()

Returns a sentence that describes the setting (for example "Record event with duration above or equal to threshold").

If the setting lacks a description, the description for the type that is associated with this setting is returned, or null if doesn't exist.

Returns:String

the description, or null if doesn't exist

getLabelback to summary
public String getLabel()

Returns a human-readable name that describes the setting (for example, "Threshold").

If the setting lacks a label, the label for the type that is associated with this setting is returned, or null if doesn't exist

Returns:String

a human-readable name, or null if doesn't exist

getNameback to summary
public String getName()

Returns the name of the setting (for example, "threshold").

Returns:String

the name, not null

getTypeback to summary
pack-priv Type getType()
getTypeIdback to summary
public long getTypeId()

Returns a unique ID for the type in the Java Virtual Machine (JVM).

The ID might not be the same between JVM instances.

Returns:long

the type ID, not negative

getTypeNameback to summary
public String getTypeName()

Returns the fully qualified class name of the type that is associated with this setting descriptor.

Returns:String

the type name, not null

See Also
SettingDescriptor#getTypeId()
setAnnotationsback to summary
pack-priv void setAnnotations(List<AnnotationElement> as)