Package com.atlassian.bamboo.utils
Class BambooSuppliers
- java.lang.Object
-
- com.atlassian.bamboo.utils.BambooSuppliers
-
public class BambooSuppliers extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BambooSuppliers.ResettableMemoizingSupplier<T>
-
Constructor Summary
Constructors Constructor Description BambooSuppliers()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <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.
-
-
-
Method Detail
-
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)
-
-