Top Constructors Methods
com.vladsch.flexmark.util.data

public Class NullableDataKey<T>

extends DataKeyBase<T>
Class Inheritance
Imports
org.jetbrains.annotations.NotNull, .Nullable, java.util.function.Supplier

Constructor Summary

AccessConstructor and Description
public
NullableDataKey(@NotNull String name, T
default to use when data holder is null
defaultValue
,
@NotNull DataValueFactory<T>
data value factory for creating a new default value for the key for a non-null data holder
factory
)

Creates a DataKey with nullable data value and factory with non-nullable dataHolder

Use this constructor to ensure that factory is never called with null data holder value

public
NullableDataKey(@NotNull String name, @NotNull DataValueNullableFactory<T>
data value factory for creating a new default value for the key
factory
)

Creates a DataKey with a computed default value dynamically.

public
NullableDataKey(@NotNull String name, @NotNull Supplier<T>
data value factory for creating a new default value for the key not dependent on dataHolder
supplier
)

Creates a DataKey with nullable data value and factory not dependent on data holder

Use this constructor to ensure that factory is never called with null data holder value

public
NullableDataKey(@NotNull String name, @NotNull DataKeyBase<T>
The NullableDataKey to take the default value from at time of construction.
defaultKey
)

Creates a NullableDataKey with a dynamic default value taken from a value of another key

does not cache the returned default value but will always delegate to another key until this key gets its own value set.

public
NullableDataKey(@NotNull String name, T defaultValue)

public
NullableDataKey(@NotNull String
key name
name
)

Create a DataKey with null default value and factory producing null values

Method Summary

Modifier and TypeMethod and Description
public T
public T
public T
public @NotNull MutableDataHolder
set(@NotNull MutableDataHolder dataHolder, T value)

public String
toString()

Overrides com.vladsch.flexmark.util.data.DataKeyBase.toString.

Returns a string representation of the object.

Inherited from com.vladsch.flexmark.util.data.DataKeyBase:
equalsgetgetDefaultValuegetFactorygetFromgetNamehashCode

Constructor Detail

NullableDataKeyback to summary
public NullableDataKey(@NotNull String name, T defaultValue, @NotNull DataValueFactory<T> factory)

Creates a DataKey with nullable data value and factory with non-nullable dataHolder

Use this constructor to ensure that factory is never called with null data holder value

Parameters
name:@NotNull String

See getName().

defaultValue:T

default to use when data holder is null

factory:@NotNull DataValueFactory<T>

data value factory for creating a new default value for the key for a non-null data holder

NullableDataKeyback to summary
public NullableDataKey(@NotNull String name, @NotNull DataValueNullableFactory<T> factory)

Creates a DataKey with a computed default value dynamically.

On construction will invoke factory with null data holder to get the default value

Parameters
name:@NotNull String

See getName().

factory:@NotNull DataValueNullableFactory<T>

data value factory for creating a new default value for the key

NullableDataKeyback to summary
public NullableDataKey(@NotNull String name, @NotNull Supplier<T> supplier)

Creates a DataKey with nullable data value and factory not dependent on data holder

Use this constructor to ensure that factory is never called with null data holder value

Parameters
name:@NotNull String

See getName().

supplier:@NotNull Supplier<T>

data value factory for creating a new default value for the key not dependent on dataHolder

NullableDataKeyback to summary
public NullableDataKey(@NotNull String name, @NotNull DataKeyBase<T> defaultKey)

Creates a NullableDataKey with a dynamic default value taken from a value of another key

does not cache the returned default value but will always delegate to another key until this key gets its own value set.

Parameters
name:@NotNull String

See getName().

defaultKey:@NotNull DataKeyBase<T>

The NullableDataKey to take the default value from at time of construction.

NullableDataKeyback to summary
public NullableDataKey(@NotNull String name, T defaultValue)
NullableDataKeyback to summary
public NullableDataKey(@NotNull String name)

Create a DataKey with null default value and factory producing null values

Parameters
name:@NotNull String

key name

Method Detail

getback to summary
public T get(@Nullable DataHolder holder)
Annotations
@Nullable
getDefaultValueback to summary
public T getDefaultValue()

Overrides com.vladsch.flexmark.util.data.DataKeyBase.getDefaultValue.

Annotations
@Nullable
getDefaultValueback to summary
public T getDefaultValue(@NotNull DataHolder holder)
Annotations
@Nullable
setback to summary
public @NotNull MutableDataHolder set(@NotNull MutableDataHolder dataHolder, T value)
Annotations
@Override
@NotNull
toStringback to summary
public String toString()

Overrides com.vladsch.flexmark.util.data.DataKeyBase.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override