Class Cache.Builder

  • All Implemented Interfaces:
    software.amazon.jsii.Builder<Cache>
    Enclosing interface:
    Cache

    @Stability(Experimental)
    public static final class Cache.Builder
    extends Object
    implements software.amazon.jsii.Builder<Cache>
    A builder for Cache
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • fallbackKeys

        @Stability(Experimental)
        public Cache.Builder fallbackKeys​(List<String> fallbackKeys)
        Sets the value of Cache.getFallbackKeys()
        Parameters:
        fallbackKeys - Use cache:fallback_keys to specify a list of keys to try to restore cache from if there is no cache found for the cache:key. Caches are retrieved in the order specified in the fallback_keys section.
        Returns:
        this
      • key

        @Stability(Experimental)
        public Cache.Builder key​(String key)
        Sets the value of Cache.getKey()
        Parameters:
        key - Used the to give each cache a unique identifying key. All jobs that use the same cache key use the same cache.
        Returns:
        this
      • key

        @Stability(Experimental)
        public Cache.Builder key​(CacheKeyFiles key)
        Sets the value of Cache.getKey()
        Parameters:
        key - Used the to give each cache a unique identifying key. All jobs that use the same cache key use the same cache.
        Returns:
        this
      • paths

        @Stability(Experimental)
        public Cache.Builder paths​(List<String> paths)
        Sets the value of Cache.getPaths()
        Parameters:
        paths - Defines which files or directories to cache.
        Returns:
        this
      • policy

        @Stability(Experimental)
        public Cache.Builder policy​(CachePolicy policy)
        Sets the value of Cache.getPolicy()
        Parameters:
        policy - Defines the upload and download behaviour of the cache.
        Returns:
        this
      • untracked

        @Stability(Experimental)
        public Cache.Builder untracked​(Boolean untracked)
        Sets the value of Cache.getUntracked()
        Parameters:
        untracked - If set to true all files that are untracked in your Git repository will be cached.
        Returns:
        this
      • when

        @Stability(Experimental)
        public Cache.Builder when​(CacheWhen when)
        Sets the value of Cache.getWhen()
        Parameters:
        when - Defines when to save the cache, based on the status of the job (Default: Job Success).
        Returns:
        this
      • build

        @Stability(Experimental)
        public Cache build()
        Builds the configured instance.
        Specified by:
        build in interface software.amazon.jsii.Builder<Cache>
        Returns:
        a new instance of Cache
        Throws:
        NullPointerException - if any required attribute was not provided