Class Cache

java.lang.Object
org.springframework.boot.buildpack.platform.build.Cache
Direct Known Subclasses:
Cache.Bind, Cache.Volume

public class Cache extends Object
Details of a cache for use by the CNB builder.
Since:
2.6.0
Author:
Scott Frederick
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Details of a cache stored in a bind mount.
    static enum 
    The format of the cache.
    static class 
    Details of a cache stored in a Docker volume.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final Cache.Format
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static Cache
    bind(String source)
    Create a new Cache that uses a bind mount with the provided source.
    boolean
    equals(@Nullable Object obj)
     
    @Nullable Cache.Bind
    Return the details of the cache if it is a bind cache.
    @Nullable Cache.Volume
    Return the details of the cache if it is a volume cache.
    int
     
    static Cache
    volume(String name)
    Create a new Cache that uses a volume with the provided name.
    static Cache
    Create a new Cache that uses a volume with the provided name.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Method Details

    • getVolume

      public @Nullable Cache.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

      public @Nullable Cache.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
    • volume

      public static Cache 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

      public static Cache 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

      public static Cache 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
    • equals

      public boolean equals(@Nullable Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object