org.testcontainers.images.PullPolicy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of testcontainers Show documentation
Show all versions of testcontainers Show documentation
Isolated container management for Java code testing
package org.testcontainers.images;
import lombok.experimental.UtilityClass;
import java.time.Duration;
/**
* Convenience class with logic for building common {@link ImagePullPolicy} instances.
*
*/
@UtilityClass
public class PullPolicy {
/**
* Convenience method for returning the {@link DefaultPullPolicy} default image pull policy
* @return {@link ImagePullPolicy}
*/
public static ImagePullPolicy defaultPolicy() {
return new DefaultPullPolicy();
}
/**
* Convenience method for returning the {@link AlwaysPullPolicy} alwaysPull image pull policy
* @return {@link ImagePullPolicy}
*/
public static ImagePullPolicy alwaysPull() {
return new AlwaysPullPolicy();
}
/**
* Convenience method for returning an {@link AgeBasedPullPolicy} Age based image pull policy,
* @return {@link ImagePullPolicy}
*/
public static ImagePullPolicy ageBased(Duration maxAge) {
return new AgeBasedPullPolicy(maxAge);
}
}