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 Details

  • Method Details

    • getAll

      @NotNull @NotNull Map<? extends DataKeyBase<?>,Object> getAll()
    • getKeys

      @NotNull @NotNull 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 interface MutableDataSetter
    • getOrCompute

      Object getOrCompute(@NotNull @NotNull DataKeyBase<?> key, @NotNull @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 - data key
      factory - 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()