Interface DataHolder

    • Method Detail

      • getAll

        @NotNull
        java.util.Map<? extends DataKeyBase<?>,​java.lang.Object> getAll()
      • getKeys

        @NotNull
        java.util.Collection<? extends DataKeyBase<?>> getKeys()
      • contains

        boolean contains​(@NotNull
                         DataKeyBase<?> key)
      • get

        @Deprecated
        @Nullable
        default <T> T get​(@NotNull
                          DataKey<T> key)
        Deprecated.
        Type Parameters:
        T - Type returned by key
        Parameters:
        key - data key
        Returns:
        Use key.get(dataHolder) instead
      • getOrCompute

        java.lang.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 - data key
        factory - factory taking this data holder and computing/providing default value
        Returns:
        object value for the key
      • toDataSet

        @NotNull
        default DataSet toDataSet()