Interface Cache

All Known Subinterfaces:
LocalCache
All Known Implementing Classes:
ImageCache, LocalCache.Bind, LocalCache.Volume

public sealed interface Cache permits LocalCache, ImageCache
Details of a cache for use by the CNB builder.
Since:
2.6.0
Author:
Scott Frederick, Tim Ysewyn, Stephane Nicoll
  • Method Summary

    Modifier and Type
    Method
    Description
    static LocalCache
    bind(String source)
    Create a new Cache that uses a bind mount with the provided source.
    default @Nullable LocalCache.Bind
    Return the details of the cache if it is a bind cache.
    default @Nullable ImageCache
    Return the details of the cache if it is an image cache.
    default @Nullable LocalCache.Volume
    Return the details of the cache if it is a volume cache.
    static ImageCache
    image(String name)
    Create a new Cache that uses an image with the provided name.
    static LocalCache
    volume(String name)
    Create a new Cache that uses a volume with the provided name.
    static LocalCache
    Create a new Cache that uses a volume with the provided name.
  • Method Details

    • getVolume

      default @Nullable LocalCache.Volume getVolume()
      Return the details of the cache if it is a volume cache.
      Returns:
      the cache, or null if it is not a volume cache
    • getBind

      default @Nullable LocalCache.Bind getBind()
      Return the details of the cache if it is a bind cache.
      Returns:
      the cache, or null if it is not a bind cache
    • getImage

      default @Nullable ImageCache getImage()
      Return the details of the cache if it is an image cache.
      Returns:
      the cache, or null if it is not an image cache
      Since:
      4.2.0
    • volume

      static LocalCache volume(String name)
      Create a new Cache that uses a volume with the provided name.
      Parameters:
      name - the cache volume name
      Returns:
      a new cache instance
    • volume

      static LocalCache volume(VolumeName name)
      Create a new Cache that uses a volume with the provided name.
      Parameters:
      name - the cache volume name
      Returns:
      a new cache instance
    • bind

      static LocalCache bind(String source)
      Create a new Cache that uses a bind mount with the provided source.
      Parameters:
      source - the cache bind mount source
      Returns:
      a new cache instance
    • image

      static ImageCache image(String name)
      Create a new Cache that uses an image with the provided name.
      Parameters:
      name - the cache image name
      Returns:
      a new cache instance
      Since:
      4.2.0