Interface InfoPanelItemProvider

    • Method Detail

      • getContributions

        java.util.Collection<? extends InfoPanelItem> getContributions​(GraphContainer container)
        Returns all contributions for the current state of the given container.
        Parameters:
        container - the container used to decide which contributions to show
        Returns:
        a bunch of contributions, if any. Should NEVER return null
      • contributeIf

        static <T extends InfoPanelItem> java.util.Collection<T> contributeIf​(boolean predicate,
                                                                              java.util.function.Supplier<T> supplier)
        Helper method to create the Contributions Collection. If predicate is true a singleton Collection with the value of Supplier.get() is returned. If predicate is false an empty Collection is returned, instead.
        Type Parameters:
        T - The type of the InfoPanelItem
        Parameters:
        predicate - Whether or not the value of Supplier.get() is used (true means it is used)
        supplier - The supplier to use. If predicate is true it must NOT be null
        Returns:
        a singleton Collection with the value of Supplier.get() if predicate is true, otherwise an empty collection