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

public Interface DataHolder

extends MutableDataSetter
Known Direct Subinterfaces
com.vladsch.flexmark.util.data.MutableDataHolder
Known Direct Implementers
com.vladsch.flexmark.util.data.DataSet
Imports
org.jetbrains.annotations.NotNull, .Nullable, java.util.Collection, .Map

Field Summary

Modifier and TypeField and Description
public static final DataHolder

Method Summary

Modifier and TypeMethod and Description
public boolean
public default <
Type returned by key
T
>
T

Returns:

Use key.get(dataHolder) instead
get
(@NotNull DataKey<T>
data key
key
)
Deprecated

public @NotNull Map<? extends DataKeyBase<?>, Object>
public @NotNull Collection<? extends DataKeyBase<?>>
public Object

Returns:

object value for the key
getOrCompute
(@NotNull DataKeyBase<?>
data key
key
,
@NotNull DataValueFactory<?>
factory taking this data holder and computing/providing default value
factory
)

Get key if it exists or compute using supplier

Method used by DataKey classes to access data.

public default @NotNull MutableDataHolder
public default @NotNull DataSet
public @NotNull DataHolder
public @NotNull MutableDataHolder
Inherited from com.vladsch.flexmark.util.data.MutableDataSetter:
setIn

Field Detail

NULLback to summary
public static final DataHolder NULL

Method Detail

containsback to summary
public boolean contains(@NotNull DataKeyBase<?> key)
getback to summary
public default <T> T get(@NotNull DataKey<T> key)

Deprecated

Parameters
<T>
Type returned by key
key:@NotNull DataKey<T>

data key

Returns:T

Use key.get(dataHolder) instead

Annotations
@Deprecated
@Nullable
getAllback to summary
public @NotNull Map<? extends DataKeyBase<?>, Object> getAll()
Annotations
@NotNull
getKeysback to summary
public @NotNull Collection<? extends DataKeyBase<?>> getKeys()
Annotations
@NotNull
getOrComputeback to summary
public Object getOrCompute(@NotNull DataKeyBase<?> key, @NotNull DataValueFactory<?> factory)

Get key if it exists or compute using supplier

Method used by DataKey classes to access data.

Note

MutableDataHolders will compute an absent key and add it to its dataSet. DataHolders will return computed value but not change contained dataSet because they are immutable. So value will be computed every time it is requested.

Parameters
key:@NotNull DataKeyBase<?>

data key

factory:@NotNull DataValueFactory<?>

factory taking this data holder and computing/providing default value

Returns:Object

object value for the key

setInback to summary
public default @NotNull MutableDataHolder setIn(@NotNull MutableDataHolder dataHolder)
Annotations
@Override
@NotNull
toDataSetback to summary
public default @NotNull DataSet toDataSet()
Annotations
@NotNull
toImmutableback to summary
public @NotNull DataHolder toImmutable()
Annotations
@NotNull
toMutableback to summary
public @NotNull MutableDataHolder toMutable()
Annotations
@NotNull