Class BambooSuppliers

java.lang.Object
com.atlassian.bamboo.utils.BambooSuppliers

public class BambooSuppliers extends Object
  • Constructor Details

    • BambooSuppliers

      public BambooSuppliers()
  • Method Details

    • memoizeWithFixedTtl

      @NotNull public static <T> @NotNull Supplier<T> memoizeWithFixedTtl(@NotNull @NotNull Supplier<T> supplier, @NotNull @NotNull Duration ttl)
      Memoizes the provided supplier. The value is guaranteed to be no more than ttl old. TTL countdown starts when the provided supplier's get method returns.
    • memoizeWithAdaptiveTtl

      @NotNull public static <T> @NotNull Supplier<T> memoizeWithAdaptiveTtl(Supplier<T> supplier, Duration minTtl, Duration maxTtl)
      Memoizes the provided supplier. The value is guaranteed to be no more than <minTtl;maxTtl> old. The actual TTL value used is equal to the time taken by the supplier.get(), capped by the ttl range. TTL countdown starts when the provided supplier's get method returns.
    • memoizeResettably

      public static <E> BambooSuppliers.ResettableMemoizingSupplier<E> memoizeResettably(com.google.common.base.Supplier<E> supplier)