APIdia Launch Partner
Top Fields Constructors Methods
jdk.jfr.internal.settings

pack-priv abstract Class BooleanSetting

extends SettingControl
Class Inheritance
Known Direct Subclasses
jdk.jfr.internal.settings.EnabledSetting, jdk.jfr.internal.settings.StackTraceSetting
Imports
java.util.Objects, .Set, jdk.jfr.SettingControl, jdk.jfr.internal.PlatformEventType

Field Summary

Modifier and TypeField and Description
private final String
private final PlatformEventType
private String

Constructor Summary

AccessConstructor and Description
public
BooleanSetting(PlatformEventType eventType, String defaultValue)

Method Summary

Modifier and TypeMethod and Description
protected abstract void
apply(PlatformEventType eventType, boolean value)

public String
combine(Set<String> values)

Implements abstract jdk.jfr.SettingControl.combine.

Combines the setting values for all running recordings into one value when multiple recordings are running at the same time,

The semantics of how setting values are combined depends on the setting control that is implemented, but all recordings should get at least all the events they request.

public String
getValue()

Implements abstract jdk.jfr.SettingControl.getValue.

Returns the currently used value for this setting, not null.

private static Boolean
parse(String value)

public void
setValue(String value)

Implements abstract jdk.jfr.SettingControl.setValue.

Sets the value for this setting.

Field Detail

defaultValueback to summary
private final String defaultValue
eventTypeback to summary
private final PlatformEventType eventType
valueback to summary
private String value

Constructor Detail

BooleanSettingback to summary
public BooleanSetting(PlatformEventType eventType, String defaultValue)

Method Detail

applyback to summary
protected abstract void apply(PlatformEventType eventType, boolean value)
combineback to summary
public String combine(Set<String> values)

Implements abstract jdk.jfr.SettingControl.combine.

Doc from jdk.jfr.SettingControl.combine.

Combines the setting values for all running recordings into one value when multiple recordings are running at the same time,

The semantics of how setting values are combined depends on the setting control that is implemented, but all recordings should get at least all the events they request.

This method should have no side effects, because the caller might cache values. This method should never return null or throw an exception. If a value is not valid for this setting control, the value should be ignored.

Examples:

if the setting control represents a threshold and three recordings are running at the same time with the setting values "10 ms", "8 s", and "1 ms", this method returns "1 ms" because it means that all recordings get at least all the requested data.

If the setting control represents a set of names and two recordings are running at the same time with the setting values "Smith, Jones" and "Jones, Williams" the returned value is "Smith, Jones, Williams" because all names would be accepted.

If the setting control represents a boolean condition and four recordings are running at the same time with the following values "true", "false", "false", and "incorrect", this method returns "true", because all recordings get at least all the requested data.

Annotations
@Override
getValueback to summary
public String getValue()

Implements abstract jdk.jfr.SettingControl.getValue.

Doc from jdk.jfr.SettingControl.getValue.

Returns the currently used value for this setting, not null.

The value returned by this method is valid as an argument to both the setValue(String) method and combine(Set) method.

This method is invoked when an event is registered to obtain the default value. It is therefore important that a valid value can be returned immediately after an instance of this class is created. It is not valid to return null.

Annotations
@Override
parseback to summary
private static Boolean parse(String value)
setValueback to summary
public void setValue(String value)

Implements abstract jdk.jfr.SettingControl.setValue.

Doc from jdk.jfr.SettingControl.setValue.

Sets the value for this setting.

If the setting value is not valid for this setting, this method does not throw an exception. Instead, the value is ignored.

Annotations
@Override