Package com.atlassian.bamboo.utils
Class BambooSuppliers
java.lang.Object
com.atlassian.bamboo.utils.BambooSuppliers
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <E> BambooSuppliers.ResettableMemoizingSupplier<E>
memoizeResettably
(com.google.common.base.Supplier<E> supplier) static <T> @NotNull Supplier<T>
memoizeWithAdaptiveTtl
(Supplier<T> supplier, Duration minTtl, Duration maxTtl) Memoizes the provided supplier.static <T> @NotNull Supplier<T>
memoizeWithFixedTtl
(@NotNull Supplier<T> supplier, @NotNull Duration ttl) Memoizes the provided supplier.
-
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)
-