All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.testcontainers.images.PullPolicy Maven / Gradle / Ivy

There is a newer version: 1.20.3
Show newest version
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);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy