Package com.vladsch.flexmark.util.data
Interface DataHolder
-
- All Superinterfaces:
MutableDataSetter
- All Known Subinterfaces:
MutableDataHolder
,RendererBuilder
- All Known Implementing Classes:
BuilderBase
,DataSet
,Document
,FlexmarkHtmlConverter.Builder
,Formatter.Builder
,HtmlRenderer.Builder
,MutableDataSet
,MutableScopedDataSet
,Parser.Builder
,ScopedDataSet
public interface DataHolder extends MutableDataSetter
-
-
Field Summary
Fields Modifier and Type Field Description static DataHolder
NULL
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description boolean
contains(@NotNull DataKeyBase<?> key)
default <T> T
get(@NotNull DataKey<T> key)
Deprecated.@NotNull java.util.Map<? extends DataKeyBase<?>,java.lang.Object>
getAll()
@NotNull java.util.Collection<? extends DataKeyBase<?>>
getKeys()
java.lang.Object
getOrCompute(@NotNull DataKeyBase<?> key, @NotNull DataValueFactory<?> factory)
Get key if it exists or compute using supplierdefault @NotNull MutableDataHolder
setIn(@NotNull MutableDataHolder dataHolder)
default @NotNull DataSet
toDataSet()
@NotNull DataHolder
toImmutable()
@NotNull MutableDataHolder
toMutable()
-
-
-
Field Detail
-
NULL
static final DataHolder NULL
-
-
Method Detail
-
getAll
@NotNull @NotNull java.util.Map<? extends DataKeyBase<?>,java.lang.Object> getAll()
-
getKeys
@NotNull @NotNull java.util.Collection<? extends DataKeyBase<?>> getKeys()
-
contains
boolean contains(@NotNull @NotNull DataKeyBase<?> key)
-
get
@Deprecated @Nullable default <T> T get(@NotNull @NotNull DataKey<T> key)
Deprecated.- Type Parameters:
T
- Type returned by key- Parameters:
key
- data key- Returns:
- Use key.get(dataHolder) instead
-
setIn
@NotNull default @NotNull MutableDataHolder setIn(@NotNull @NotNull MutableDataHolder dataHolder)
- Specified by:
setIn
in interfaceMutableDataSetter
-
getOrCompute
java.lang.Object getOrCompute(@NotNull @NotNull DataKeyBase<?> key, @NotNull @NotNull DataValueFactory<?> factory)
Get key if it exists or compute using supplierMethod 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
- data keyfactory
- factory taking this data holder and computing/providing default value- Returns:
- object value for the key
-
toMutable
@NotNull @NotNull MutableDataHolder toMutable()
-
toImmutable
@NotNull @NotNull DataHolder toImmutable()
-
toDataSet
@NotNull default @NotNull DataSet toDataSet()
-
-