Class ScopedDataSet

    • Constructor Detail

      • ScopedDataSet

        public ScopedDataSet​(@Nullable
                             @Nullable DataHolder parent)
      • ScopedDataSet

        public ScopedDataSet​(@Nullable
                             @Nullable DataHolder parent,
                             @Nullable
                             @Nullable DataHolder other)
    • Method Detail

      • getOrCompute

        @Nullable
        public @Nullable java.lang.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
        Overrides:
        getOrCompute in class DataSet
        Parameters:
        key - data key
        factory - factory taking this data holder and computing/providing default value
        Returns:
        object value for the key