Interface MutableDataHolder

All Superinterfaces:
DataHolder, MutableDataSetter
All Known Implementing Classes:
BuilderBase, Document, FlexmarkHtmlConverter.Builder, Formatter.Builder, HtmlRenderer.Builder, MutableDataSet, MutableScopedDataSet, Parser.Builder

public interface MutableDataHolder extends DataHolder, MutableDataSetter
  • Method Details

    • get

      @Deprecated default <T> T get(@NotNull @NotNull DataKey<T> key)
      Deprecated.
      use key.get(dataHolder) instead, which will do the same thing an carries nullable information for the data
      Get the given key, if it does not exist then use the key's factory to create a new value and put it into the collection so that the following get of the same key will find a value
      Specified by:
      get in interface DataHolder
      Type Parameters:
      T - Type returned by key
      Parameters:
      key - data key
      Returns:
      return stored value or newly created value
    • getOrCompute

      Object getOrCompute(@NotNull @NotNull DataKeyBase<?> key, @NotNull @NotNull DataValueFactory<?> factory)
      Description copied from interface: DataHolder
      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.

      Specified by:
      getOrCompute in interface DataHolder
      Parameters:
      key - data key
      factory - factory taking this data holder and computing/providing default value
      Returns:
      object value for the key
    • set

      @NotNull <T> @NotNull MutableDataHolder set(@NotNull @NotNull DataKey<T> key, @NotNull T value)
      Store the given value for the key
      Type Parameters:
      T - data type of the data referred by the key
      Parameters:
      key - data key
      value - value to store
      Returns:
      mutable data holder for chained calls
    • set

      @NotNull <T> @NotNull MutableDataHolder set(@NotNull @NotNull NullableDataKey<T> key, @Nullable T value)
      Store the given value for the key
      Type Parameters:
      T - data type of the data referred by the key
      Parameters:
      key - data key
      value - value to store
      Returns:
      mutable data holder for chained calls
    • remove

      @NotNull @NotNull MutableDataHolder remove(@NotNull @NotNull DataKeyBase<?> key)
      Remove the stored value for the key, used to force to default or to force recompute
      Parameters:
      key - data key to remove
      Returns:
      mutable data holder for chained calls
    • setFrom

      @NotNull @NotNull MutableDataHolder setFrom(@NotNull @NotNull MutableDataSetter dataSetter)
      Store the given value for the key
      Parameters:
      dataSetter - data setter which will set values
      Returns:
      mutable data holder for chained calls
    • setAll

      @NotNull @NotNull MutableDataHolder setAll(@NotNull @NotNull DataHolder other)
      Copy all values from one data holder to this data holder
      Parameters:
      other - data holder from which to copy all values
      Returns:
      mutable data holder for chained calls
    • setIn

      @NotNull @NotNull MutableDataHolder setIn(@NotNull @NotNull MutableDataHolder dataHolder)
      Set options in given mutable data holder
      Specified by:
      setIn in interface DataHolder
      Specified by:
      setIn in interface MutableDataSetter
      Parameters:
      dataHolder - data holder where to copy options from this data holder
      Returns:
      dataHolder
    • clear

      @NotNull @NotNull MutableDataHolder clear()
      clear all options out of the data set
      Returns:
      mutable data holder for chained calls